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;
using System.Collections.Generic;
using UnityEngine;
public class WorldDimCalc : MonoBehaviour {
public Vector3 dimensions;
private void Awake()
{
if (dimensions == Vector3.zero)
{
BoxCollider bc = GetComponentInChildren<BoxCollider>();
dimensions = new Vector3(bc.bounds.size.x, bc.bounds.size.y, bc.bounds.size.z);
}
}
}
| 22 | 91 | 0.645933 | [
"MIT"
] | DrFrolicks/TheRunningElection | Assets/Scripts/WorldDimCalc.cs | 420 | C# |
namespace Cocona.ShellCompletion.Candidate
{
/// <summary>
/// Specifies the type of a completion candidate result while generating a shell script.
/// </summary>
public enum CompletionCandidateResultType
{
Default,
File,
Directory,
Keywords
}
}
| 21.571429 | 92 | 0.63245 | [
"MIT"
] | 1Franck/Cocona | src/Cocona.Core/ShellCompletion/Candidate/CompletionCandidateResultType.cs | 302 | C# |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
namespace StarkPlatform.CodeAnalysis.Host
{
/// <summary>
/// Per language services provided by the host environment.
/// </summary>
public abstract class HostLanguageServices
{
/// <summary>
/// The <see cref="HostWorkspaceServices"/> that originated this language service.
/// </summary>
public abstract HostWorkspaceServices WorkspaceServices { get; }
/// <summary>
/// The name of the language
/// </summary>
public abstract string Language { get; }
/// <summary>
/// Gets a language specific service provided by the host identified by the service type.
/// If the host does not provide the service, this method returns null.
/// </summary>
public abstract TLanguageService GetService<TLanguageService>() where TLanguageService : ILanguageService;
/// <summary>
/// Gets a language specific service provided by the host identified by the service type.
/// If the host does not provide the service, this method returns throws <see cref="InvalidOperationException"/>.
/// </summary>
public TLanguageService GetRequiredService<TLanguageService>() where TLanguageService : ILanguageService
{
var service = GetService<TLanguageService>();
if (service == null)
{
throw new InvalidOperationException(WorkspacesResources.Service_of_type_0_is_required_to_accomplish_the_task_but_is_not_available_from_the_workspace);
}
return service;
}
// common services
/// <summary>
/// A factory for creating compilations instances.
/// </summary>
internal virtual ICompilationFactoryService CompilationFactory
{
get { return this.GetService<ICompilationFactoryService>(); }
}
// needs some work on the interface before it can be public
internal virtual ISyntaxTreeFactoryService SyntaxTreeFactory
{
get { return this.GetService<ISyntaxTreeFactoryService>(); }
}
}
}
| 38.483333 | 166 | 0.650498 | [
"Apache-2.0"
] | stark-lang/stark-roslyn | src/Workspaces/Core/Portable/Workspace/Host/HostLanguageServices.cs | 2,311 | C# |
namespace Forum.App.Controllers
{
using Forum.App.Controllers.Contracts;
using Forum.App.Services;
using Forum.App.UserInterface;
using Forum.App.UserInterface.Contracts;
using Forum.App.UserInterface.Input;
using Forum.App.UserInterface.ViewModels;
using System.Linq;
public class AddPostController : IController
{
private enum Command { AddTitle, AddCategory, Write, Post }
private const int COMMAND_COUNT = 4;
private const int TEXT_AREA_WIDTH = 37;
private const int TEXT_AREA_HEIGHT = 18;
private const int POST_MAX_LENGTH = 660;
private static int centerTop = Position.ConsoleCenter().Top;
private static int centerLeft = Position.ConsoleCenter().Left;
public PostViewModel Post { get; private set; }
public TextArea TextArea { get; set; }
public bool Error { get; private set; }
public AddPostController()
{
ResetPost();
}
public MenuState ExecuteCommand(int index)
{
switch ((Command)index)
{
case Command.AddTitle:
ReadTitle();
return MenuState.AddPost;
case Command.AddCategory:
ReadCategory();
return MenuState.AddPost;
case Command.Write:
TextArea.Write();
Post.Content = TextArea.Lines.ToArray();
return MenuState.AddPost;
case Command.Post:
var postAdded = PostService.TrySavePost(Post);
if (!postAdded)
{
Error = true;
return MenuState.Rerender;
}
return MenuState.PostAdded;
}
throw new InvalidCommandException();
}
public IView GetView(string userName)
{
this.Post.Author = userName;
return new AddPostView(Post, TextArea, Error);
}
private void ReadTitle()
{
this.Post.Title = ForumViewEngine.ReadRow();
ForumViewEngine.HideCursor();
}
private void ReadCategory()
{
this.Post.Category = ForumViewEngine.ReadRow();
ForumViewEngine.HideCursor();
}
public void ResetPost()
{
this.Error = false;
this.Post = new PostViewModel();
this.TextArea = new TextArea(centerLeft - 18, centerTop - 7,
TEXT_AREA_WIDTH, TEXT_AREA_HEIGHT, POST_MAX_LENGTH);
}
}
}
| 31.458824 | 72 | 0.545999 | [
"MIT"
] | GitHarr/SoftUni | Homework/C#Fundamentals/C# OOP Basics/7. Workshop/Forum.App/Controllers/AddPostController.cs | 2,676 | C# |
using UnityEngine;
namespace FirstPerson.Interaction
{
public class Interactable : MonoBehaviour
{
[SerializeField] string nameToDisplay = null;
#region Properties
public virtual string Name => nameToDisplay;
#endregion
#region Cached references
protected PlayerInteraction player;
#endregion
private void Awake()
{
SetReferences();
}
protected virtual void InteractWith()
{
}
protected virtual void TakeAll()
{
}
protected virtual void OutOfRange()
{
}
protected virtual bool IsSame()
{
return PlayerInteraction.InteractableObject != null
&& PlayerInteraction.InteractableObject == this;
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject == References.Player)
{
player.OnInteraction += InteractWith;
player.OnButtonHeldDown += TakeAll;
}
}
private void OnTriggerExit(Collider other)
{
if (other.gameObject == References.Player)
{
OutOfRange();
player.OnInteraction -= InteractWith;
player.OnButtonHeldDown -= TakeAll;
}
}
private void OnDisable()
{
player.OnInteraction -= InteractWith;
player.OnButtonHeldDown -= TakeAll;
}
protected virtual void SetReferences()
{
player = References.Player.GetComponent<PlayerInteraction>();
}
}
}
| 21.615385 | 73 | 0.53796 | [
"MIT"
] | MarceloCSC/First-Person-Prototype | Assets/Scripts/Interaction System/Interactable.cs | 1,688 | C# |
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace BaseData.Web.Areas.HelpPage.ModelDescriptions
{
public class ParameterDescription
{
public ParameterDescription()
{
Annotations = new Collection<ParameterAnnotation>();
}
public Collection<ParameterAnnotation> Annotations { get; private set; }
public string Documentation { get; set; }
public string Name { get; set; }
public ModelDescription TypeDescription { get; set; }
}
} | 25.857143 | 80 | 0.675875 | [
"Apache-2.0"
] | twb0223/dms.basedata | DMS.BaseData/BaseData.Web/Areas/HelpPage/ModelDescriptions/ParameterDescription.cs | 543 | C# |
using System.Collections.Generic;
using Horizon.Payment.Alipay.Response;
namespace Horizon.Payment.Alipay.Request
{
/// <summary>
/// alipay.open.mini.morpho.app.offline
/// </summary>
public class AlipayOpenMiniMorphoAppOfflineRequest : IAlipayRequest<AlipayOpenMiniMorphoAppOfflineResponse>
{
/// <summary>
/// 下线应用
/// </summary>
public string BizContent { get; set; }
#region IAlipayRequest Members
private bool needEncrypt = false;
private string apiVersion = "1.0";
private string terminalType;
private string terminalInfo;
private string prodCode;
private string notifyUrl;
private string returnUrl;
private AlipayObject bizModel;
public void SetNeedEncrypt(bool needEncrypt)
{
this.needEncrypt = needEncrypt;
}
public bool GetNeedEncrypt()
{
return needEncrypt;
}
public void SetNotifyUrl(string notifyUrl)
{
this.notifyUrl = notifyUrl;
}
public string GetNotifyUrl()
{
return notifyUrl;
}
public void SetReturnUrl(string returnUrl)
{
this.returnUrl = returnUrl;
}
public string GetReturnUrl()
{
return returnUrl;
}
public void SetTerminalType(string terminalType)
{
this.terminalType = terminalType;
}
public string GetTerminalType()
{
return terminalType;
}
public void SetTerminalInfo(string terminalInfo)
{
this.terminalInfo = terminalInfo;
}
public string GetTerminalInfo()
{
return terminalInfo;
}
public void SetProdCode(string prodCode)
{
this.prodCode = prodCode;
}
public string GetProdCode()
{
return prodCode;
}
public string GetApiName()
{
return "alipay.open.mini.morpho.app.offline";
}
public void SetApiVersion(string apiVersion)
{
this.apiVersion = apiVersion;
}
public string GetApiVersion()
{
return apiVersion;
}
public IDictionary<string, string> GetParameters()
{
var parameters = new AlipayDictionary
{
{ "biz_content", BizContent }
};
return parameters;
}
public AlipayObject GetBizModel()
{
return bizModel;
}
public void SetBizModel(AlipayObject bizModel)
{
this.bizModel = bizModel;
}
#endregion
}
}
| 22.532258 | 111 | 0.544381 | [
"Apache-2.0"
] | bluexray/Horizon.Sample | Horizon.Payment.Alipay/Request/AlipayOpenMiniMorphoAppOfflineRequest.cs | 2,804 | C# |
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
namespace DotMarkdown
{
internal abstract class MarkdownBaseWriter : MarkdownWriter
{
private int _lineStartPos;
private int _emptyLineStartPos = -1;
private int _headingLevel = -1;
private List<TableColumnInfo> _tableColumns;
private int _tableColumnCount = -1;
private int _tableRowIndex = -1;
private int _tableColumnIndex = -1;
private int _tableCellPos = -1;
protected State _state;
private int _orderedItemNumber;
private readonly Collection<ElementInfo> _stack = new Collection<ElementInfo>();
protected MarkdownBaseWriter(MarkdownWriterSettings settings = null)
{
Settings = settings ?? MarkdownWriterSettings.Default;
}
public override WriteState WriteState
{
get
{
switch (_state)
{
case State.Start:
return WriteState.Start;
case State.SimpleElement:
case State.IndentedCodeBlock:
case State.FencedCodeBlock:
case State.HorizontalRule:
case State.Heading:
case State.Bold:
case State.Italic:
case State.Strikethrough:
case State.Table:
case State.TableRow:
case State.TableCell:
case State.BlockQuote:
case State.BulletItem:
case State.OrderedItem:
case State.TaskItem:
case State.Document:
return WriteState.Content;
case State.Closed:
return WriteState.Closed;
case State.Error:
return WriteState.Error;
default:
throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(_state));
}
}
}
public override MarkdownWriterSettings Settings { get; }
protected internal abstract int Length { get; set; }
protected Func<char, bool> ShouldBeEscaped { get; set; } = MarkdownEscaper.ShouldBeEscaped;
protected char EscapingChar { get; set; } = '\\';
private TableColumnInfo CurrentColumn => _tableColumns[_tableColumnIndex];
private bool IsFirstColumn => _tableColumnIndex == 0;
private bool IsLastColumn => _tableColumnIndex == _tableColumnCount - 1;
private void Push(State state, int orderedItemNumber = 0)
{
if (_state == State.Closed)
throw new InvalidOperationException("Cannot write to a closed writer.");
if (_state == State.Error)
throw new InvalidOperationException("Cannot write to a writer in error state.");
State newState = _stateTable[((int)_state * 16) + (int)state - 1];
if (newState == State.Error)
throw new InvalidOperationException($"Cannot write '{state}' when state is '{_state}'.");
_stack.Add(new ElementInfo((_state == State.Start) ? State.Document : _state, orderedItemNumber));
_state = newState;
_orderedItemNumber = orderedItemNumber;
}
private void Pop(State state)
{
int count = _stack.Count;
if (count == 0)
throw new InvalidOperationException($"Cannot close '{state}' when state is '{_state}'.");
if (_state != state)
throw new InvalidOperationException($"Cannot close '{state}' when state is '{_state}'.");
ElementInfo info = _stack[count - 1];
_state = info.State;
_orderedItemNumber = info.Number;
_stack.RemoveAt(count - 1);
}
private void ThrowIfCannotWriteEnd(State state)
{
if (state != _state)
throw new InvalidOperationException($"Cannot close '{state}' when state is '{_state}'.");
}
public override void WriteStartBold()
{
try
{
Push(State.Bold);
WriteRaw(Format.BoldDelimiter);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndBold()
{
try
{
ThrowIfCannotWriteEnd(State.Bold);
WriteRaw(Format.BoldDelimiter);
Pop(State.Bold);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteBold(string text)
{
try
{
base.WriteBold(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartItalic()
{
try
{
Push(State.Italic);
WriteRaw(Format.ItalicDelimiter);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndItalic()
{
try
{
ThrowIfCannotWriteEnd(State.Italic);
WriteRaw(Format.ItalicDelimiter);
Pop(State.Italic);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteItalic(string text)
{
try
{
base.WriteItalic(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartStrikethrough()
{
try
{
Push(State.Strikethrough);
WriteRaw("~~");
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndStrikethrough()
{
try
{
ThrowIfCannotWriteEnd(State.Strikethrough);
WriteRaw("~~");
Pop(State.Strikethrough);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStrikethrough(string text)
{
try
{
base.WriteStrikethrough(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteInlineCode(string text)
{
if (text == null)
return;
int length = text.Length;
if (length == 0)
return;
try
{
Push(State.SimpleElement);
int backtickLength = GetBacktickLength();
for (int i = 0; i < backtickLength; i++)
WriteRaw("`");
if (text[0] == '`')
WriteRaw(" ");
WriteString(text, _ => false);
if (text[length - 1] == '`')
WriteRaw(" ");
for (int i = 0; i < backtickLength; i++)
WriteRaw("`");
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
int GetBacktickLength()
{
int minLength = 0;
int maxLength = 0;
for (int i = 0; i < length; i++)
{
if (text[i] == '`')
{
i++;
int len = 1;
while (i < length
&& text[i] == '`')
{
len++;
i++;
}
if (minLength == 0)
{
minLength = len;
maxLength = len;
}
else if (len < minLength)
{
minLength = len;
}
else if (len > maxLength)
{
maxLength = len;
}
}
}
if (minLength == 1)
{
return maxLength + 1;
}
else
{
return 1;
}
}
}
public override void WriteStartHeading(int level)
{
try
{
Error.ThrowOnInvalidHeadingLevel(level);
Push(State.Heading);
_headingLevel = level;
bool underline = (level == 1 && Format.UnderlineHeading1)
|| (level == 2 && Format.UnderlineHeading2);
WriteLine(Format.EmptyLineBeforeHeading);
if (!underline)
{
WriteRaw(Format.HeadingStart, level);
WriteRaw(" ");
}
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndHeading()
{
try
{
ThrowIfCannotWriteEnd(State.Heading);
int level = _headingLevel;
_headingLevel = -1;
bool underline = (level == 1 && Format.UnderlineHeading1)
|| (level == 2 && Format.UnderlineHeading2);
if (!underline
&& Format.CloseHeading)
{
WriteRaw(" ");
WriteRaw(Format.HeadingStart, level);
}
int length = Length - _lineStartPos;
WriteLineIfNecessary();
if (underline)
{
WriteRaw((level == 1) ? "=" : "-", length);
WriteLine();
}
WriteEmptyLineIf(Format.EmptyLineAfterHeading);
Pop(State.Heading);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteHeading(int level, string text)
{
try
{
base.WriteHeading(level, text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartBulletItem()
{
try
{
WriteLineIfNecessary();
WriteRaw(Format.BulletItemStart);
Push(State.BulletItem);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndBulletItem()
{
try
{
Pop(State.BulletItem);
WriteLineIfNecessary();
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteBulletItem(string text)
{
try
{
base.WriteBulletItem(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartOrderedItem(int number)
{
try
{
Error.ThrowOnInvalidItemNumber(number);
WriteLineIfNecessary();
WriteValue(number);
WriteRaw(Format.OrderedItemStart);
Push(State.OrderedItem, number);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndOrderedItem()
{
try
{
Pop(State.OrderedItem);
WriteLineIfNecessary();
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteOrderedItem(int number, string text)
{
try
{
base.WriteOrderedItem(number, text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartTaskItem(bool isCompleted = false)
{
try
{
WriteLineIfNecessary();
if (isCompleted)
{
WriteRaw("- [x] ");
}
else
{
WriteRaw("- [ ] ");
}
Push(State.TaskItem);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndTaskItem()
{
try
{
Pop(State.TaskItem);
WriteLineIfNecessary();
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteTaskItem(string text, bool isCompleted = false)
{
try
{
base.WriteTaskItem(text, isCompleted);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteImage(string text, string url, string title = null)
{
try
{
if (text == null)
throw new ArgumentNullException(nameof(text));
Error.ThrowOnInvalidUrl(url);
Push(State.SimpleElement);
WriteRaw("!");
WriteSquareBrackets(text);
WriteRaw("(");
WriteString(url, MarkdownEscaper.ShouldBeEscapedInLinkUrl);
WriteLinkTitle(title);
WriteRaw(")");
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartLink()
{
try
{
Push(State.Link);
WriteRaw("[");
ShouldBeEscaped = MarkdownEscaper.ShouldBeEscapedInLinkText;
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndLink(string url, string title = null)
{
try
{
Error.ThrowOnInvalidUrl(url);
ThrowIfCannotWriteEnd(State.Link);
ShouldBeEscaped = MarkdownEscaper.ShouldBeEscaped;
WriteRaw("]");
WriteRaw("(");
WriteString(url, MarkdownEscaper.ShouldBeEscapedInLinkUrl);
WriteLinkTitle(title);
WriteRaw(")");
Pop(State.Link);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteLink(string text, string url, string title = null)
{
try
{
base.WriteLink(text, url, title);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteAutolink(string url)
{
try
{
Error.ThrowOnInvalidUrl(url);
Push(State.SimpleElement);
WriteAngleBrackets(url);
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteImageReference(string text, string label)
{
try
{
Push(State.SimpleElement);
WriteRaw("!");
WriteLinkReferenceCore(text, label);
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteLinkReference(string text, string label = null)
{
try
{
Push(State.SimpleElement);
WriteLinkReferenceCore(text, label);
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
private void WriteLinkReferenceCore(string text, string label = null)
{
WriteSquareBrackets(text);
WriteSquareBrackets(label);
}
public override void WriteLabel(string label, string url, string title = null)
{
try
{
Error.ThrowOnInvalidUrl(url);
Push(State.SimpleElement);
WriteLineIfNecessary();
WriteSquareBrackets(label);
WriteRaw(": ");
WriteAngleBrackets(url);
WriteLinkTitle(title);
WriteLineIfNecessary();
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
private void WriteLinkTitle(string title)
{
if (string.IsNullOrEmpty(title))
return;
WriteRaw(" ");
WriteRaw("\"");
WriteString(title, MarkdownEscaper.ShouldBeEscapedInLinkTitle);
WriteRaw("\"");
}
private void WriteSquareBrackets(string text)
{
WriteRaw("[");
WriteString(text, MarkdownEscaper.ShouldBeEscapedInLinkText);
WriteRaw("]");
}
private void WriteAngleBrackets(string text)
{
WriteRaw("<");
WriteString(text, MarkdownEscaper.ShouldBeEscapedInAngleBrackets);
WriteRaw(">");
}
public override void WriteIndentedCodeBlock(string text)
{
try
{
Push(State.IndentedCodeBlock);
WriteLine(Format.EmptyLineBeforeCodeBlock);
WriteString(text, _ => false);
WriteLine();
WriteEmptyLineIf(Format.EmptyLineAfterCodeBlock);
Pop(State.IndentedCodeBlock);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteFencedCodeBlock(string text, string info = null)
{
try
{
Error.ThrowOnInvalidFencedCodeBlockInfo(info);
Push(State.FencedCodeBlock);
WriteLine(Format.EmptyLineBeforeCodeBlock);
WriteRaw(Format.CodeFence);
WriteRaw(info);
WriteLine();
WriteString(text, _ => false);
WriteLineIfNecessary();
WriteRaw(Format.CodeFence);
WriteLine();
WriteEmptyLineIf(Format.EmptyLineAfterCodeBlock);
Pop(State.FencedCodeBlock);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartBlockQuote()
{
try
{
Push(State.BlockQuote);
WriteLineIfNecessary();
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndBlockQuote()
{
try
{
ThrowIfCannotWriteEnd(State.BlockQuote);
WriteLineIfNecessary();
Pop(State.BlockQuote);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteBlockQuote(string text)
{
try
{
base.WriteBlockQuote(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteHorizontalRule(HorizontalRuleStyle style, int count = HorizontalRuleFormat.DefaultCount, string separator = HorizontalRuleFormat.DefaultSeparator)
{
try
{
Error.ThrowOnInvalidHorizontalRuleCount(count);
Error.ThrowOnInvalidHorizontalRuleSeparator(separator);
Push(State.HorizontalRule);
WriteLineIfNecessary();
bool isFirst = true;
string text = GetText();
for (int i = 0; i < count; i++)
{
if (isFirst)
{
isFirst = false;
}
else
{
WriteRaw(separator);
}
WriteRaw(text);
}
WriteLine();
Pop(State.HorizontalRule);
}
catch
{
_state = State.Error;
throw;
}
string GetText()
{
switch (style)
{
case HorizontalRuleStyle.Hyphen:
return "-";
case HorizontalRuleStyle.Underscore:
return "_";
case HorizontalRuleStyle.Asterisk:
return "*";
default:
throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(style));
}
}
}
public override void WriteStartTable(int columnCount)
{
WriteStartTable(null, columnCount);
}
public override void WriteStartTable(IReadOnlyList<TableColumnInfo> columns)
{
if (columns == null)
throw new ArgumentNullException(nameof(columns));
WriteStartTable(columns, columns.Count);
}
private void WriteStartTable(IReadOnlyList<TableColumnInfo> columns, int columnCount)
{
if (columnCount <= 0)
throw new ArgumentOutOfRangeException(nameof(columnCount), columnCount, "Table must have at least one column.");
try
{
Push(State.Table);
WriteLine(Format.EmptyLineBeforeTable);
if (_tableColumns == null)
_tableColumns = new List<TableColumnInfo>(columnCount);
if (columns != null)
{
_tableColumns.AddRange(columns);
}
else
{
for (int i = 0; i < columnCount; i++)
{
_tableColumns.Add(new TableColumnInfo(HorizontalAlignment.Left, width: 0, isWhiteSpace: true));
}
}
_tableColumnCount = columnCount;
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndTable()
{
try
{
ThrowIfCannotWriteEnd(State.Table);
_tableRowIndex = -1;
_tableColumns.Clear();
_tableColumnCount = -1;
WriteEmptyLineIf(Format.EmptyLineAfterTable);
Pop(State.Table);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartTableRow()
{
try
{
Push(State.TableRow);
_tableRowIndex++;
_tableColumnIndex = -1;
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndTableRow()
{
try
{
ThrowIfCannotWriteEnd(State.TableRow);
if (Format.TableOuterDelimiter
|| (_tableRowIndex == 0 && CurrentColumn.IsWhiteSpace))
{
WriteTableColumnSeparator();
}
WriteLine();
_tableColumnIndex = -1;
Pop(State.TableRow);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteStartTableCell()
{
try
{
Push(State.TableCell);
_tableColumnIndex++;
if (IsFirstColumn)
{
if (Format.TableOuterDelimiter
|| _tableColumnCount == 1
|| CurrentColumn.IsWhiteSpace)
{
WriteTableColumnSeparator();
}
}
else
{
WriteTableColumnSeparator();
}
if (_tableRowIndex == 0)
{
if (Format.TablePadding)
{
WriteRaw(" ");
}
else if (Format.FormatTableHeader
&& CurrentColumn.Alignment == HorizontalAlignment.Center)
{
WriteRaw(" ");
}
}
else if (Format.TablePadding)
{
WriteRaw(" ");
}
_tableCellPos = Length;
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEndTableCell()
{
try
{
ThrowIfCannotWriteEnd(State.TableCell);
int width = Length - _tableCellPos;
TableColumnInfo currentColumn = CurrentColumn;
if (currentColumn.Width == 0
&& width > 0)
{
_tableColumns[_tableColumnIndex] = currentColumn.WithWidth(width);
}
if (Format.TableOuterDelimiter
|| !IsLastColumn)
{
if (_tableRowIndex == 0)
{
if (Format.FormatTableHeader)
WritePadRight(width);
}
else if (Format.FormatTableContent)
{
WritePadRight(width);
}
}
if (_tableRowIndex == 0)
{
if (Format.TablePadding)
{
WriteRaw(" ");
}
else if (Format.FormatTableHeader
&& CurrentColumn.Alignment != HorizontalAlignment.Left)
{
WriteRaw(" ");
}
}
else if (Format.TablePadding)
{
if (width > 0)
WriteRaw(" ");
}
_tableCellPos = -1;
Pop(State.TableCell);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteTableCell(string text)
{
try
{
base.WriteTableCell(text);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteTableHeaderSeparator()
{
try
{
WriteLineIfNecessary();
WriteStartTableRow();
int count = _tableColumnCount;
for (int i = 0; i < count; i++)
{
_tableColumnIndex = i;
if (IsFirstColumn)
{
if (Format.TableOuterDelimiter
|| IsLastColumn
|| CurrentColumn.IsWhiteSpace)
{
WriteTableColumnSeparator();
}
}
else
{
WriteTableColumnSeparator();
}
if (CurrentColumn.Alignment == HorizontalAlignment.Center)
{
WriteRaw(":");
}
else if (Format.TablePadding)
{
WriteRaw(" ");
}
WriteRaw("---");
if (Format.FormatTableHeader)
WritePadRight(3, "-");
if (CurrentColumn.Alignment != HorizontalAlignment.Left)
{
WriteRaw(":");
}
else if (Format.TablePadding)
{
WriteRaw(" ");
}
}
WriteEndTableRow();
}
catch
{
_state = State.Error;
throw;
}
}
private void WriteTableColumnSeparator()
{
WriteRaw("|");
}
private void WritePadRight(int width, string padding = " ")
{
int totalWidth = Math.Max(CurrentColumn.Width, Math.Max(width, 3));
WriteRaw(padding, totalWidth - width);
}
public override void WriteCharEntity(char value)
{
try
{
Error.ThrowOnInvalidCharEntity(value);
Push(State.SimpleElement);
WriteRaw("&#");
if (Format.CharEntityFormat == CharEntityFormat.Hexadecimal)
{
WriteRaw("x");
WriteRaw(((int)value).ToString("X", CultureInfo.InvariantCulture));
}
else if (Format.CharEntityFormat == CharEntityFormat.Decimal)
{
WriteRaw(((int)value).ToString(CultureInfo.InvariantCulture));
}
else
{
throw new InvalidOperationException(ErrorMessages.UnknownEnumValue(Format.CharEntityFormat));
}
WriteRaw(";");
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteEntityRef(string name)
{
try
{
Push(State.SimpleElement);
WriteRaw("&");
WriteRaw(name);
WriteRaw(";");
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public override void WriteComment(string text)
{
try
{
if (!string.IsNullOrEmpty(text))
{
if (text.IndexOf("--", StringComparison.Ordinal) >= 0)
throw new ArgumentException("XML comment text cannot contain '--'.");
if (text[text.Length - 1] == '-')
throw new ArgumentException("Last character of XML comment text cannot be '-'.");
}
Push(State.SimpleElement);
WriteRaw("<!-- ");
WriteRaw(text);
WriteRaw(" -->");
Pop(State.SimpleElement);
}
catch
{
_state = State.Error;
throw;
}
}
public void BeforeWriteString()
{
if (_state == State.Table
|| _state == State.TableRow)
{
throw new InvalidOperationException($"Cannot write text in state '{_state}'.");
}
else if (_state == State.Start)
{
_state = State.Document;
}
if (_lineStartPos == Length)
WriteIndentation();
}
private void WriteString(string text, Func<char, bool> shouldBeEscaped, char escapingChar = '\\')
{
Func<char, bool> tmp = ShouldBeEscaped;
try
{
ShouldBeEscaped = shouldBeEscaped;
EscapingChar = escapingChar;
WriteString(text);
}
finally
{
EscapingChar = '\\';
ShouldBeEscaped = tmp;
}
}
public void BeforeWriteRaw()
{
if (_state == State.Start)
_state = State.Document;
if (_lineStartPos == Length)
WriteIndentation();
}
private void WriteRaw(string data, int repeatCount)
{
for (int i = 0; i < repeatCount; i++)
WriteRaw(data);
}
protected void WriteIndentation()
{
for (int i = 0; i < _stack.Count; i++)
{
WriteIndentation(_stack[i].State, _stack[i].Number);
}
if (_state == State.IndentedCodeBlock)
{
this.WriteIndentation(" ");
}
else
{
WriteIndentation(_state, _orderedItemNumber);
}
void WriteIndentation(State state, int orderedItemNumber)
{
switch (state)
{
case State.BulletItem:
case State.TaskItem:
{
this.WriteIndentation(" ");
break;
}
case State.OrderedItem:
{
int count = orderedItemNumber.GetDigitCount() + Format.OrderedItemStart.Length;
this.WriteIndentation(TextUtility.GetSpaces(count));
break;
}
case State.BlockQuote:
{
this.WriteIndentation("> ");
break;
}
}
}
}
protected abstract void WriteIndentation(string value);
protected abstract void WriteNewLineChars();
protected void OnBeforeWriteLine()
{
if (_tableColumnCount > 0)
{
if (_state == State.TableCell)
ThrowOnNewLineInTableCell();
if (_state != State.Table
|| _state != State.TableRow)
{
for (int i = _stack.Count - 1; i >= 0; i--)
{
switch (_stack[i].State)
{
case State.Table:
case State.TableRow:
{
break;
}
case State.TableCell:
{
ThrowOnNewLineInTableCell();
break;
}
}
}
}
}
if (_lineStartPos == Length)
{
_emptyLineStartPos = _lineStartPos;
}
else
{
_emptyLineStartPos = -1;
}
void ThrowOnNewLineInTableCell()
{
throw new InvalidOperationException("Cannot write newline characters in a table cell.");
}
}
protected void OnAfterWriteLine()
{
if (_emptyLineStartPos == _lineStartPos)
_emptyLineStartPos = Length;
_lineStartPos = Length;
}
public override void WriteLine()
{
try
{
OnBeforeWriteLine();
WriteNewLineChars();
OnAfterWriteLine();
}
catch
{
_state = State.Error;
throw;
}
}
internal void WriteLineIfNecessary()
{
if (_lineStartPos != Length)
WriteLine();
}
private void WriteEmptyLineIf(bool condition)
{
if (condition
&& Length > 0)
{
WriteLine();
}
}
private void WriteLine(bool addEmptyLine)
{
if (_emptyLineStartPos != Length)
{
if (_lineStartPos != Length)
WriteLine();
WriteEmptyLineIf(addEmptyLine);
}
}
protected enum State
{
Start = 0,
SimpleElement = 1,
FencedCodeBlock = 2,
IndentedCodeBlock = 3,
HorizontalRule = 4,
Heading = 5,
Bold = 6,
Italic = 7,
Strikethrough = 8,
Link = 9,
Table = 10,
TableRow = 11,
TableCell = 12,
BulletItem = 13,
OrderedItem = 14,
TaskItem = 15,
BlockQuote = 16,
Document = 17,
Closed = 18,
Error = 19
}
[DebuggerDisplay("{DebuggerDisplay,nq}")]
private readonly struct ElementInfo
{
public ElementInfo(State state, int number)
{
State = state;
Number = number;
}
public State State { get; }
public int Number { get; }
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay
{
get { return $"{State} {Number}"; }
}
}
private static readonly State[] _stateTable =
{
/* State.Start */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote,
/* State.SimpleElement */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.FencedCodeBlock */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.IndentedCodeBlock */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.HorizontalRule */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Heading */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Bold */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Italic */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Strikethrough */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Link,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Link */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.Table */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.TableRow,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.TableRow */
/* State.SimpleElement */ State.Error,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Error,
/* State.Italic */ State.Error,
/* State.Strikethrough */ State.Error,
/* State.Link */ State.Error,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.TableCell,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.TableCell */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.Error,
/* State.IndentedCodeBlock */ State.Error,
/* State.HorizontalRule */ State.Error,
/* State.Heading */ State.Error,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Error,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.Error,
/* State.OrderedItem */ State.Error,
/* State.TaskItem */ State.Error,
/* State.BlockQuote */ State.Error,
/* State.BulletItem */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote,
/* State.OrderedItem */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote,
/* State.TaskItem */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote,
/* State.BlockQuote */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote,
/* State.Document */
/* State.SimpleElement */ State.SimpleElement,
/* State.FencedCodeBlock */ State.FencedCodeBlock,
/* State.IndentedCodeBlock */ State.IndentedCodeBlock,
/* State.HorizontalRule */ State.HorizontalRule,
/* State.Heading */ State.Heading,
/* State.Bold */ State.Bold,
/* State.Italic */ State.Italic,
/* State.Strikethrough */ State.Strikethrough,
/* State.Link */ State.Link,
/* State.Table */ State.Table,
/* State.TableRow */ State.Error,
/* State.TableCell */ State.Error,
/* State.BulletItem */ State.BulletItem,
/* State.OrderedItem */ State.OrderedItem,
/* State.TaskItem */ State.TaskItem,
/* State.BlockQuote */ State.BlockQuote
};
}
} | 31.755272 | 180 | 0.422924 | [
"Apache-2.0"
] | bovorasr/DotMarkdown | src/DotMarkdown/MarkdownBaseWriter.cs | 57,225 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// This is a test script for the purpuse of making sure i can commit
// If anyone wants to test thier commit add a there name below:
// David Mayfield
public class TestScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
| 19.391304 | 68 | 0.665919 | [
"Unlicense"
] | DavidMayfield1818/RPG-Dungeon-Video | Assets/Scripts/TestScript.cs | 446 | C# |
#if UNIX
//
// Copyright (C) Microsoft. All rights reserved.
//
using System.Diagnostics.Eventing;
using System.Management.Automation.Configuration;
using System.Management.Automation.Internal;
using System.Text;
using System.Collections.Generic;
namespace System.Management.Automation.Tracing
{
/// <summary>
/// SysLog LogProvider implementation.
/// </summary>
internal class PSSysLogProvider : LogProvider
{
private static SysLogProvider s_provider;
// by default, do not include analytic events
internal const PSKeyword DefaultKeywords = (PSKeyword) (0xFFFFFFFFFFFFFFFF & ~(ulong)PSKeyword.UseAlwaysAnalytic);
/// <summary>
/// Class constructor.
/// </summary>
static PSSysLogProvider()
{
s_provider = new SysLogProvider(PowerShellConfig.Instance.GetSysLogIdentity(),
PowerShellConfig.Instance.GetLogLevel(),
PowerShellConfig.Instance.GetLogKeywords(),
PowerShellConfig.Instance.GetLogChannels());
}
/// <summary>
/// Defines a thread local StringBuilder for building event payload strings.
/// </summary>
/// <remarks>
/// NOTE: do not access this field directly, use the PayloadBuilder
/// property to ensure correct thread initialization; otherwise, a null reference can occur.
/// </remarks>
[ThreadStatic]
private static StringBuilder _payloadBuilder;
private static StringBuilder PayloadBuilder
{
get
{
if (_payloadBuilder == null)
{
// NOTE: Thread static fields must be explicitly initialized for each thread.
_payloadBuilder = new StringBuilder(200);
}
return _payloadBuilder;
}
}
/// <summary>
/// Determines whether any session is requesting the specified event from the provider.
/// </summary>
/// <param name="level"></param>
/// <param name="keywords"></param>
/// <returns></returns>
/// <remarks>
/// Typically, a provider does not call this method to determine whether a session requested the specified event;
/// the provider simply writes the event, and ETW determines whether the event is logged to a session. A provider
/// may want to call this function if the provider needs to perform extra work to generate the event. In this case,
/// calling this function first to determine if a session requested the event or not, may save resources and time.
/// </remarks>
internal bool IsEnabled(PSLevel level, PSKeyword keywords)
{
return s_provider.IsEnabled(level, keywords);
}
/// <summary>
/// Provider interface function for logging health event
/// </summary>
/// <param name="logContext"></param>
/// <param name="eventId"></param>
/// <param name="exception"></param>
/// <param name="additionalInfo"></param>
///
internal override void LogEngineHealthEvent(LogContext logContext, int eventId, Exception exception, Dictionary<String, String> additionalInfo)
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
AppendException(payload, exception);
payload.AppendLine();
AppendAdditionalInfo(payload, additionalInfo);
WriteEvent(PSEventId.Engine_Health, PSChannel.Operational, PSOpcode.Exception, PSTask.ExecutePipeline, logContext, payload.ToString());
}
/// <summary>
/// Provider interface function for logging engine lifecycle event
/// </summary>
/// <param name="logContext"></param>
/// <param name="newState"></param>
/// <param name="previousState"></param>
///
internal override void LogEngineLifecycleEvent(LogContext logContext, EngineState newState, EngineState previousState)
{
if (IsEnabled(PSLevel.Informational, PSKeyword.Cmdlets | PSKeyword.UseAlwaysAnalytic))
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.EngineStateChange, previousState.ToString(), newState.ToString()));
PSTask task = PSTask.EngineStart;
if (newState == EngineState.Stopped ||
newState == EngineState.OutOfService ||
newState == EngineState.None ||
newState == EngineState.Degraded)
{
task = PSTask.EngineStop;
}
WriteEvent(PSEventId.Engine_Lifecycle, PSChannel.Analytic, PSOpcode.Method, task, logContext, payload.ToString());
}
}
/// <summary>
/// Provider interface function for logging command health event
/// </summary>
/// <param name="logContext"></param>
/// <param name="exception"></param>
internal override void LogCommandHealthEvent(LogContext logContext, Exception exception)
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
AppendException(payload, exception);
WriteEvent(PSEventId.Command_Health, PSChannel.Operational, PSOpcode.Exception, PSTask.ExecutePipeline, logContext, payload.ToString());
}
/// <summary>
/// Provider interface function for logging command lifecycle event
/// </summary>
/// <param name="getLogContext"></param>
/// <param name="newState"></param>
///
internal override void LogCommandLifecycleEvent(Func<LogContext> getLogContext, CommandState newState)
{
if (IsEnabled(PSLevel.Informational, PSKeyword.Cmdlets | PSKeyword.UseAlwaysAnalytic))
{
LogContext logContext = getLogContext();
StringBuilder payload = PayloadBuilder;
payload.Clear();
if (logContext.CommandType != null)
{
if (logContext.CommandType.Equals(StringLiterals.Script, StringComparison.OrdinalIgnoreCase))
{
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.ScriptStateChange, newState.ToString()));
}
else
{
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.CommandStateChange, logContext.CommandName, newState.ToString()));
}
}
PSTask task = PSTask.CommandStart;
if (newState == CommandState.Stopped ||
newState == CommandState.Terminated)
{
task = PSTask.CommandStop;
}
WriteEvent(PSEventId.Command_Lifecycle, PSChannel.Analytic, PSOpcode.Method, task, logContext, payload.ToString());
}
}
/// <summary>
/// Provider interface function for logging pipeline execution detail.
/// </summary>
/// <param name="logContext"></param>
/// <param name="pipelineExecutionDetail"></param>
internal override void LogPipelineExecutionDetailEvent(LogContext logContext, List<String> pipelineExecutionDetail)
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
if (pipelineExecutionDetail != null)
{
foreach (String detail in pipelineExecutionDetail)
{
payload.AppendLine(detail);
}
}
WriteEvent(PSEventId.Pipeline_Detail, PSChannel.Operational, PSOpcode.Method, PSTask.ExecutePipeline, logContext, payload.ToString());
}
/// <summary>
/// Provider interface function for logging provider health event
/// </summary>
/// <param name="logContext"></param>
/// <param name="providerName"></param>
/// <param name="exception"></param>
internal override void LogProviderHealthEvent(LogContext logContext, string providerName, Exception exception)
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
AppendException(payload, exception);
payload.AppendLine();
Dictionary<String, String> additionalInfo = new Dictionary<string, string>();
additionalInfo.Add(EtwLoggingStrings.ProviderNameString, providerName);
AppendAdditionalInfo(payload, additionalInfo);
WriteEvent(PSEventId.Provider_Health, PSChannel.Operational, PSOpcode.Exception, PSTask.ExecutePipeline, logContext, payload.ToString());
}
/// <summary>
/// Provider interface function for logging provider lifecycle event
/// </summary>
/// <param name="logContext"></param>
/// <param name="providerName"></param>
/// <param name="newState"></param>
///
internal override void LogProviderLifecycleEvent(LogContext logContext, string providerName, ProviderState newState)
{
if (IsEnabled(PSLevel.Informational, PSKeyword.Cmdlets | PSKeyword.UseAlwaysAnalytic))
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.ProviderStateChange, providerName, newState.ToString()));
PSTask task = PSTask.ProviderStart;
if (newState == ProviderState.Stopped)
{
task = PSTask.ProviderStop;
}
WriteEvent(PSEventId.Provider_Lifecycle, PSChannel.Analytic, PSOpcode.Method, task, logContext, payload.ToString());
}
}
/// <summary>
/// Provider interface function for logging settings event
/// </summary>
/// <param name="logContext"></param>
/// <param name="variableName"></param>
/// <param name="value"></param>
/// <param name="previousValue"></param>
///
internal override void LogSettingsEvent(LogContext logContext, string variableName, string value, string previousValue)
{
if (IsEnabled(PSLevel.Informational, PSKeyword.Cmdlets | PSKeyword.UseAlwaysAnalytic))
{
StringBuilder payload = PayloadBuilder;
payload.Clear();
if (previousValue == null)
{
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.SettingChangeNoPrevious, variableName, value));
}
else
{
payload.AppendLine(StringUtil.Format(EtwLoggingStrings.SettingChange, variableName, previousValue, value));
}
WriteEvent(PSEventId.Settings, PSChannel.Analytic, PSOpcode.Method, PSTask.ExecutePipeline, logContext, payload.ToString());
}
}
/// <summary>
/// The SysLog provider does not use logging variables
/// </summary>
/// <returns></returns>
internal override bool UseLoggingVariables()
{
return false;
}
/// <summary>
/// Writes a single event
/// </summary>
/// <param name="id">event id</param>
/// <param name="channel"></param>
/// <param name="opcode"></param>
/// <param name="task"></param>
/// <param name="logContext">log context</param>
/// <param name="payLoad"></param>
internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad)
{
s_provider.Log(id, channel, task, opcode, GetPSLevelFromSeverity(logContext.Severity), DefaultKeywords,
LogContextToString(logContext),
GetPSLogUserData(logContext.ExecutionContext),
payLoad);
}
/// <summary>
/// Writes an event
/// </summary>
/// <param name="id"></param>
/// <param name="channel"></param>
/// <param name="opcode"></param>
/// <param name="level"></param>
/// <param name="task"></param>
/// <param name="keyword"></param>
/// <param name="args"></param>
internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSLevel level, PSTask task, PSKeyword keyword, params object[] args)
{
s_provider.Log(id, channel, task, opcode, level, keyword, args);
}
/// <summary>
/// Writes an activity transfer event
/// </summary>
internal void WriteTransferEvent(Guid parentActivityId)
{
s_provider.LogTransfer(parentActivityId);
}
/// <summary>
/// Sets the activity id for the current thread.
/// </summary>
/// <param name="newActivityId">the GUID identifying the activity.</param>
internal void SetActivityIdForCurrentThread(Guid newActivityId)
{
s_provider.SetActivity(newActivityId);
}
}
}
#endif // UNIX
| 39.938053 | 151 | 0.586676 | [
"Apache-2.0",
"MIT-0"
] | rsumner31/PowerShell-2 | src/System.Management.Automation/utils/tracing/PSSysLogProvider.cs | 13,539 | C# |
using System;
using Equinor.ProCoSys.Preservation.Command.EventHandlers.HistoryEvents;
using Equinor.ProCoSys.Preservation.Domain.AggregateModels.HistoryAggregate;
using Equinor.ProCoSys.Preservation.Domain.Events;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
namespace Equinor.ProCoSys.Preservation.Command.Tests.EventHandlers.HistoryEvents
{
[TestClass]
public class PreservationCompletedEventHandlerTests
{
private Mock<IHistoryRepository> _historyRepositoryMock;
private PreservationCompletedEventHandler _dut;
private History _historyAdded;
[TestInitialize]
public void Setup()
{
// Arrange
_historyRepositoryMock = new Mock<IHistoryRepository>();
_historyRepositoryMock
.Setup(repo => repo.Add(It.IsAny<History>()))
.Callback<History>(history =>
{
_historyAdded = history;
});
_dut = new PreservationCompletedEventHandler(_historyRepositoryMock.Object);
}
[TestMethod]
public void Handle_ShouldAddPreservationCompletedHistoryRecord()
{
// Arrange
Assert.IsNull(_historyAdded);
// Act
var objectGuid = Guid.NewGuid();
var plant = "TestPlant";
_dut.Handle(new PreservationCompletedEvent(plant, objectGuid), default);
// Assert
Assert.IsNotNull(_historyAdded);
Assert.AreEqual(plant, _historyAdded.Plant);
Assert.AreEqual(objectGuid, _historyAdded.ObjectGuid);
Assert.IsNotNull(_historyAdded.Description);
Assert.AreEqual(EventType.PreservationCompleted, _historyAdded.EventType);
Assert.AreEqual(ObjectType.Tag, _historyAdded.ObjectType);
Assert.IsFalse(_historyAdded.PreservationRecordGuid.HasValue);
Assert.IsFalse(_historyAdded.DueInWeeks.HasValue);
}
}
}
| 36.436364 | 88 | 0.659681 | [
"MIT"
] | equinor/pcs-preservation-api | src/tests/Equinor.ProCoSys.Preservation.Command.Tests/EventHandlers/HistoryEvents/PreservationCompletedEventHandlerTests.cs | 2,006 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Angulari18n
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
}
| 24.125 | 99 | 0.587219 | [
"MIT"
] | johnproctor/SimpleAngulari18n | Angulari18n/App_Start/RouteConfig.cs | 581 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using Apkd;
using Odin = Sirenix.OdinInspector;
public class HealthComponent : MonoBehaviour
{
[S] public float MaxHealth { get; private set; }
[S] public float CurrentHealth { get; private set; }
public float Percentage => CurrentHealth / MaxHealth;
[S] public UnityEvent OnDamaged { get; set; }
[S] public UnityEvent OnDestroy { get; set; }
public GameObject gameOverScreen;
[Inject.Singleton] GameManager gameManager { get; }
private void Start()
{
CurrentHealth = MaxHealth;
}
public void AddHealth(float value)
{
if(value < 0)
{
Debug.LogError("AddHealth value should be bigger than 0");
return;
}
CurrentHealth += value;
if (CurrentHealth > MaxHealth)
CurrentHealth = MaxHealth;
}
public void DealDamage(float value)
{
if (value < 0)
{
Debug.LogError("DealDamage value should be bigger than 0");
return;
}
CurrentHealth -= value;
OnDamaged.Invoke();
if (CurrentHealth <= 0)
KillThis();
}
void KillThis()
{
OnDestroy.Invoke();
}
[Odin.Button]
public void Add1Damage() => DealDamage(1f);
}
| 21.904762 | 71 | 0.596377 | [
"Apache-2.0"
] | anitamiring/Tear-ible-paper | GayJam_2019/Assets/Code/Game/HealthComponent.cs | 1,382 | C# |
//
// ColorUtils.cs
//
// Lunar Unity Mobile Console
// https://github.com/SpaceMadness/lunar-unity-console
//
// Copyright 2017 Alex Lementuev, SpaceMadness.
//
// 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 UnityEngine;
using System.Collections;
namespace LunarConsolePluginInternal
{
static class ColorUtils
{
private const float kMultiplier = 1.0f / 255.0f;
public static Color FromRGBA(uint value)
{
float r = ((value >> 24) & 0xff) * kMultiplier;
float g = ((value >> 16) & 0xff) * kMultiplier;
float b = ((value >> 8) & 0xff) * kMultiplier;
float a = (value & 0xff) * kMultiplier;
return new Color(r, g, b, a);
}
public static Color FromRGB(uint value)
{
float r = ((value >> 16) & 0xff) * kMultiplier;
float g = ((value >> 8) & 0xff) * kMultiplier;
float b = (value & 0xff) * kMultiplier;
float a = 1.0f;
return new Color(r, g, b, a);
}
public static uint ToRGBA(ref Color value)
{
uint r = (uint)(value.r * 255.0f) & 0xff;
uint g = (uint)(value.g * 255.0f) & 0xff;
uint b = (uint)(value.b * 255.0f) & 0xff;
uint a = (uint)(value.a * 255.0f) & 0xff;
return (r << 24) | (g << 16) | (b << 8) | a;
}
}
}
| 30.492063 | 76 | 0.577824 | [
"MIT"
] | pdyxs/UnityProjectStarter | Assets/Plugins/Externals/LunarConsole/Scripts/Utils/ColorUtils.cs | 1,923 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RageEngine;
using RageEngine.ContentPipeline;
using SharpDX;
namespace RageEngine.Graphics.TwoD {
public static class FontRenderer {
public static void Draw(string font, string text, Vector2 position, Color4 color, float size = 1) {
Draw(FontManager.Get(font),text,position,color,size);
}
public static void Draw(Font2D font, string text, Vector2 position, Color4 color, float size = 1){
if (font == null) throw new Exception("Font doesn't exist.");
if (text == null) return;
//bool newLine = true;
Vector2 overallPosition = Vector2.Zero;
Rectangle source;
Rectangle destination;
Vector2 charPosition;
int lastChar = 0;
for (int i = 0; i < text.Length; i++)
{
// Work out current character
char character = text[i];
switch (character)
{
case '\t':
{
i++;// skip #
float r = Byte.Parse(text[i++].ToString(), System.Globalization.NumberStyles.AllowHexSpecifier);
float g = Byte.Parse(text[i++].ToString(), System.Globalization.NumberStyles.AllowHexSpecifier);
float b = Byte.Parse(text[i].ToString(), System.Globalization.NumberStyles.AllowHexSpecifier);
color = new Color4(r/15, g/15, b/15,1);
break;
}
case '\n':
{
//newLine = true;
overallPosition.X = 0.0f;
overallPosition.Y += (font.LineSpacing) * size;
break;
}
default:
{
int realIndex = font.GetCharacterIndex(character);
int characterIndex = realIndex;
if (characterIndex == -1) characterIndex = font.GetCharacterIndex('?');
//float charKerning = font.kerning.Find(letter => letter.X==lastChar && letter.Y==characterIndex).Z;
charPosition = overallPosition + position;
source = font.glyphData[characterIndex];
Rectangle cropData = font.croppingData[characterIndex];
destination = new Rectangle();
destination.Left= (int)Math.Ceiling(charPosition.X + cropData.X * size);
destination.Top = (int)Math.Ceiling(charPosition.Y + cropData.Y * size);
destination.Right=(int)Math.Ceiling(source.Width * size);
destination.Bottom=(int)Math.Ceiling(source.Height * size);
QuadRenderer.Draw(font.textureValue, destination, source, color);
overallPosition.X += cropData.Width * size;
//newLine = false;
lastChar = characterIndex;
break;
}
}
}
}
}
}
| 38.561798 | 128 | 0.477273 | [
"MIT"
] | Xerios/FacCom | RageEngine/Graphics/2D/FontRenderer.cs | 3,434 | 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("HouseBilder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HouseBilder")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f152a68f-1280-4b61-9e47-5701c4420fdd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 37.567568 | 84 | 0.747482 | [
"MIT"
] | IvanVillani/Coding | C#/coding/DataTypesVariablesMoreExercises/HouseBilder/Properties/AssemblyInfo.cs | 1,393 | C# |
using System;
namespace Fixie.Samples.NUnitStyle
{
[AttributeUsage(AttributeTargets.Class)]
public class TestFixtureAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
public class TestFixtureSetUpAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
public class SetUpAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
public class TestAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
public class TearDownAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)]
public class TestFixtureTearDownAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
public class ExpectedExceptionAttribute : Attribute
{
public ExpectedExceptionAttribute(Type exceptionType)
{
ExpectedException = exceptionType;
}
public Type ExpectedException { get; set; }
public string ExpectedMessage { get; set; }
}
} | 29.914286 | 87 | 0.719198 | [
"MIT"
] | ChrisMissal/fixie | src/Fixie.Samples/NUnitStyle/Attributes.cs | 1,049 | C# |
namespace OAuth2Server.ViewModels.Home
{
using System.ComponentModel.DataAnnotations;
public class ResourceOwnerCredentialsGrantViewModel
{
[Required]
public string Username { get; set; }
[Required]
public string Password { get; set; }
[Required]
public string ClientId { get; set; }
public string Scope { get; set; }
}
} | 22.111111 | 55 | 0.625628 | [
"Apache-2.0"
] | ErikSchierboom/basicoauth2server.persistent | OAuth2Server/ViewModels/Home/ResourceOwnerCredentialsGrantViewModel.cs | 400 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Commands.Common.KeyVault.Version2016_10_1.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Resource information with extended details.
/// </summary>
public partial class Vault : Resource
{
/// <summary>
/// Initializes a new instance of the Vault class.
/// </summary>
public Vault()
{
Properties = new VaultProperties();
CustomInit();
}
/// <summary>
/// Initializes a new instance of the Vault class.
/// </summary>
/// <param name="location">The supported Azure location where the key
/// vault should be created.</param>
/// <param name="properties">Properties of the vault</param>
/// <param name="id">The Azure Resource Manager resource ID for the key
/// vault.</param>
/// <param name="name">The name of the key vault.</param>
/// <param name="type">The resource type of the key vault.</param>
/// <param name="tags">The tags that will be assigned to the key vault.
/// </param>
public Vault(string location, VaultProperties properties, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>))
: base(location, id, name, type, tags)
{
Properties = properties;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets properties of the vault
/// </summary>
[JsonProperty(PropertyName = "properties")]
public VaultProperties Properties { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public override void Validate()
{
base.Validate();
if (Properties == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Properties");
}
if (Properties != null)
{
Properties.Validate();
}
}
}
}
| 35.53012 | 230 | 0.572737 | [
"MIT"
] | Azure/azure-powershell-common | src/KeyVault/Version2016-10-1/Models/Vault.cs | 2,949 | C# |
using DILite.WebAPI.Example.Interfaces;
using Microsoft.AspNetCore.Mvc;
namespace DILite.WebAPI.Example.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ExamplesController : ControllerBase
{
private readonly ISingleton singleton;
private readonly IScoped scoped;
public ExamplesController(ISingleton singleton, IScoped scoped)
{
this.singleton = singleton;
this.scoped = scoped;
}
[HttpGet]
public IActionResult Get()
{
singleton.DoSomething();
scoped.DoSomething();
return Ok();
}
}
}
| 23.482759 | 71 | 0.593245 | [
"MIT"
] | np-albus/DILite | examples/DILite.WebAPI.Example/Controllers/ExamplesController.cs | 683 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi.Utilities;
namespace Pulumi.Yandex
{
public static class GetVpcSecurityGroupRule
{
public static Task<GetVpcSecurityGroupRuleResult> InvokeAsync(GetVpcSecurityGroupRuleArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.InvokeAsync<GetVpcSecurityGroupRuleResult>("yandex:index/getVpcSecurityGroupRule:getVpcSecurityGroupRule", args ?? new GetVpcSecurityGroupRuleArgs(), options.WithVersion());
public static Output<GetVpcSecurityGroupRuleResult> Invoke(GetVpcSecurityGroupRuleInvokeArgs args, InvokeOptions? options = null)
=> Pulumi.Deployment.Instance.Invoke<GetVpcSecurityGroupRuleResult>("yandex:index/getVpcSecurityGroupRule:getVpcSecurityGroupRule", args ?? new GetVpcSecurityGroupRuleInvokeArgs(), options.WithVersion());
}
public sealed class GetVpcSecurityGroupRuleArgs : Pulumi.InvokeArgs
{
[Input("ruleId", required: true)]
public string RuleId { get; set; } = null!;
[Input("securityGroupBinding", required: true)]
public string SecurityGroupBinding { get; set; } = null!;
public GetVpcSecurityGroupRuleArgs()
{
}
}
public sealed class GetVpcSecurityGroupRuleInvokeArgs : Pulumi.InvokeArgs
{
[Input("ruleId", required: true)]
public Input<string> RuleId { get; set; } = null!;
[Input("securityGroupBinding", required: true)]
public Input<string> SecurityGroupBinding { get; set; } = null!;
public GetVpcSecurityGroupRuleInvokeArgs()
{
}
}
[OutputType]
public sealed class GetVpcSecurityGroupRuleResult
{
public readonly string Description;
public readonly string Direction;
public readonly int FromPort;
/// <summary>
/// The provider-assigned unique ID for this managed resource.
/// </summary>
public readonly string Id;
public readonly ImmutableDictionary<string, string> Labels;
public readonly int Port;
public readonly string PredefinedTarget;
public readonly string Protocol;
public readonly string RuleId;
public readonly string SecurityGroupBinding;
public readonly string SecurityGroupId;
public readonly int ToPort;
public readonly ImmutableArray<string> V4CidrBlocks;
public readonly ImmutableArray<string> V6CidrBlocks;
[OutputConstructor]
private GetVpcSecurityGroupRuleResult(
string description,
string direction,
int fromPort,
string id,
ImmutableDictionary<string, string> labels,
int port,
string predefinedTarget,
string protocol,
string ruleId,
string securityGroupBinding,
string securityGroupId,
int toPort,
ImmutableArray<string> v4CidrBlocks,
ImmutableArray<string> v6CidrBlocks)
{
Description = description;
Direction = direction;
FromPort = fromPort;
Id = id;
Labels = labels;
Port = port;
PredefinedTarget = predefinedTarget;
Protocol = protocol;
RuleId = ruleId;
SecurityGroupBinding = securityGroupBinding;
SecurityGroupId = securityGroupId;
ToPort = toPort;
V4CidrBlocks = v4CidrBlocks;
V6CidrBlocks = v6CidrBlocks;
}
}
}
| 32.584746 | 216 | 0.655917 | [
"ECL-2.0",
"Apache-2.0"
] | pulumi/pulumi-yandex | sdk/dotnet/GetVpcSecurityGroupRule.cs | 3,845 | C# |
using System;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
using Processing.OpenTk.Core.Rendering;
using Processing.OpenTk.Core.Math;
using Processing.OpenTk.Core.Textures;
using System.Linq;
using Processing.OpenTk.Core.Fonts;
using System.Collections.Generic;
using Processing.OpenTk.Core.Extensions;
namespace Processing.OpenTk.Core
{
public class Canvas : GameWindow, ICanvas
{
#region ICanvas
private Stack<Style> _styleStack = new Stack<Style>();
private (PVector offset, PVector size) _baseViewport = (PVector.O, PVector.O);
private Stack<(PVector offset, PVector size)> _boundryStack = new Stack<(PVector, PVector)>();
public Font Font { get => _styleStack.Peek().Font; set => _styleStack.Peek().Font = value; }
public Color4 Fill { get => _styleStack.Peek().Fill; set => _styleStack.Peek().Fill = value; }
public Color4 Stroke { get => _styleStack.Peek().Stroke; set => _styleStack.Peek().Stroke = value; }
public float StrokeWeight { get => _styleStack.Peek().StrokeWeight; set => _styleStack.Peek().StrokeWeight = value; }
public ulong FrameCount { get; set; } = 0;
public event Action<Canvas> Setup;
public event Action<Canvas> Draw;
public PVector MousePosition { get; private set; }
public void PushStyle()
{
_styleStack.Push(_styleStack.Peek().Copy());
}
public void PushStyle(Style style)
{
_styleStack.Push(style);
}
public Style PopStyle()
{
return _styleStack.Pop();
}
public void WithStyle(Style style, Action action)
{
PushStyle(style);
action();
PopStyle();
}
public void WithStyle(Action action)
{
PushStyle();
action();
PopStyle();
}
public void PushBoundry(PVector offset, PVector size)
{
_boundryStack.Push((offset, size));
ApplyBoundry();
}
public (PVector offset, PVector size) PopBoundry()
{
var result = _boundryStack.Pop();
ApplyBoundry();
return result;
}
public void WithBoundry(PVector offset, PVector size, Action action)
{
PushBoundry(offset, size);
action();
PopBoundry();
}
private void ApplyBoundry()
{
if (_boundryStack.Count == 0)
{
GL.Disable(EnableCap.ScissorTest);
}
else
{
GL.Enable(EnableCap.ScissorTest);
var offset = _boundryStack.Select(b => b.offset).Aggregate(PVector.O, (acc, off) => acc + off);
var size = _boundryStack.Peek().size;
foreach (var boundry in _boundryStack.Reverse())
GL.Scissor((int)offset.X, Height - (int)offset.Y - (int)size.Y, (int)size.X, (int)size.Y);
}
}
#endregion
#region InputEvents
public PVector PMousePosition { get; private set; }
protected virtual void OnMouseMoved() { }
protected virtual void OnMousePressed() { }
protected virtual void OnMouseReleased() { }
protected virtual void OnMouseScroll() { }
protected virtual void OnKeyPressed() { }
protected virtual void OnKeyReleased() { }
#endregion
public Canvas(int sizex, int sizey) : base(sizex, sizey, GraphicsMode.Default, "")
{
VSync = VSyncMode.On;
}
public Canvas(int sizex, int sizey, Action<Canvas> setup) : this(sizex, sizey) => setup(this);
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
GL.ClearColor(Color.CornflowerBlue);
GL.Enable(EnableCap.Blend);
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
GL.MatrixMode(MatrixMode.Projection);
_styleStack.Push(new Style());
icons = new IconCache();
Mouse.ButtonDown += (sender, args) => OnMousePressed();
Mouse.ButtonUp += (sender, args) => OnMouseReleased();
Mouse.WheelChanged += (sender, args) => OnMouseScroll();
Mouse.Move += (sender, args) => OnMouseMoved();
Keyboard.KeyDown += (sender, args) => OnKeyPressed();
Keyboard.KeyUp += (sender, args) => OnKeyReleased();
Setup?.Invoke(this);
PostOnLoad?.Invoke();
}
public Action PostOnLoad { get; set; }
protected override void OnResize(EventArgs e)
{
base.OnResize(e);
GL.Viewport(ClientRectangle.X, ClientRectangle.Y, ClientRectangle.Width, ClientRectangle.Height);
PostOnResize?.Invoke();
}
public Action PostOnResize { get; set; }
protected override void OnUpdateFrame(FrameEventArgs e)
{
base.OnUpdateFrame(e);
MousePosition = (Mouse.X, Mouse.Y);
if (Keyboard[Key.Escape])
Exit();
PostOnUpdateFrame?.Invoke(e);
}
public Action<FrameEventArgs> PostOnUpdateFrame { get; set; }
protected override void OnRenderFrame(FrameEventArgs e)
{
base.OnRenderFrame(e);
FrameCount++;
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
Draw?.Invoke(this);
SwapBuffers();
PMousePosition = MousePosition;
}
public Action<FrameEventArgs> PostOnRenderFrame { get; set; }
#region Renderer 2d
public void Background(Color4 color)
{
GL.ClearColor(color);
}
public void Triangle(PVector a, PVector b, PVector c)
{
Shape((0, 0), a, b, c);
}
public void Rectangle(PVector position, PVector size)
{
Quad(position,
position + (size.X, 0),
position + size,
position + (0, size.Y));
}
public void Quad(PVector a, PVector b, PVector c, PVector d)
{
Shape((0, 0), a, b, c, d);
}
public void Ellipse(PVector position, PVector size)
{
throw new NotImplementedException();
}
public void Line(PVector a, PVector b)
{
if (StrokeWeight <= 0)
return;
WithOrtho(() =>
{
GL.LineWidth(StrokeWeight);
GL.Color4(Stroke);
WithPrimitive(PrimitiveType.Lines, () =>
{
GL.Vertex2(a);
GL.Vertex2(b);
});
});
}
public void Arc(PVector position, PVector size, float startAngle, float sweepAngle)
{
throw new NotImplementedException();
}
public void Image(PImage image, PVector position)
{
WithOrtho(() =>
{
GL.Color4(Color4.White);
GL.Translate(position.ToVector3());
GL.Disable(EnableCap.Lighting);
GL.Enable(EnableCap.Texture2D);
WithTexture(image, () =>
{
WithPrimitive(PrimitiveType.Quads, () =>
{
GL.TexCoord2(1f, 1f);
GL.Vertex2(image.Width, image.Height);
GL.TexCoord2(0f, 1f);
GL.Vertex2(0, image.Height);
GL.TexCoord2(0f, 0f);
GL.Vertex2(0, 0);
GL.TexCoord2(1.0f, 0.0f);
GL.Vertex2(image.Width, 0);
});
});
});
}
public TextRenderResult Text(string text, PVector position) => new TextRenderResult(RenderText(text, position));
private IEnumerable<CharacterRenderResult> RenderText(string text, PVector position)
{
if (text == null)
yield break;
var characters = text.Select(c => (c, Font[c, Fill]))
.Select(t => (letter: t.Item1, texture: t.Item2.texture, yshift: t.Item2.yshift));
foreach (var character in characters)
{
Image(character.texture, position + (0, -character.texture.Height + Font.MaxHeight + character.yshift));
position += (character.texture.Width, 0);
yield return new CharacterRenderResult
{
Height = character.texture.Height + character.yshift,
Width = character.texture.Width,
Text = character.letter.ToString()
};
}
}
private static IconCache icons;
public void Icon(FontAwesomeIcons icon, float size, PVector position)
{
Image(icons[icon, size, Fill], position);
}
public void Shape(PVector position, params PVector[] points)
{
var scaled = points.Indecies(i => {
var vectors = points[i].GetOuterFaceVector(points.Previous(i), points.Next(i));
return (points[i] + vectors.pv * StrokeWeight, points[i] + vectors.ov * StrokeWeight, points[i] + vectors.nv * StrokeWeight);
});
WithOrtho(() =>
{
GL.Translate(position.ToVector3());
GL.Color4(Stroke);
WithPrimitive(PrimitiveType.Polygon, () =>
{
foreach (var vertexSet in scaled)
{
GL.Vertex2(vertexSet.Item3);
GL.Vertex2(vertexSet.Item2);
GL.Vertex2(vertexSet.Item1);
}
});
GL.Color4(Fill);
WithPrimitive(PrimitiveType.Polygon, () =>
{
foreach (var vertex in points)
GL.Vertex2(vertex);
});
});
}
#endregion
private void WithPrimitive(PrimitiveType type, Action action)
{
GL.Begin(type);
action();
GL.End();
}
private void WithOrtho(Action action)
{
GL.PushMatrix();
{
GL.LoadIdentity();
GL.Ortho(0, Width, Height, 0, -1, 1);
if (_boundryStack.Count > 0)
{
var offset = _boundryStack.Select(b => b.offset).Aggregate(PVector.O, (acc, off) => acc + off);
GL.Translate(offset.ToVector3());
}
action();
}
GL.PopMatrix();
}
private void WithTexture(PImage image, Action action)
{
GL.BindTexture(TextureTarget.Texture2D, image);
{
action();
}
GL.BindTexture(TextureTarget.Texture2D, 0);
}
}
}
| 30.912 | 145 | 0.510179 | [
"MIT"
] | KelsonBall/KoreUI | src/Processing.OpenTk.Core/Canvas.cs | 11,594 | C# |
using System;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace AppPositioner
{
class Program
{
[DllImport("user32.dll")]
public static extern bool GetWindowRect(IntPtr hwnd, ref Rect rectangle);
[DllImport("user32.dll")]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("Kernel32.dll")]
private static extern IntPtr GetConsoleWindow();
[DllImport("User32.dll")]
private static extern bool ShowWindow(IntPtr h, int cmd);
static ManagementEventWatcher processStartEvent = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStartTrace");
//static ManagementEventWatcher processStopEvent = new ManagementEventWatcher("SELECT * FROM Win32_ProcessStopTrace");
public struct Rect
{
public int Left { get; set; }
public int Top { get; set; }
public int Right { get; set; }
public int Bottom { get; set; }
}
public static string MonitorName { get; set; }
public static int MonitorNumber { get; set; }
public static string ProgramName { get; set; }
public static int Width { get; set; }
public static int Height { get; set; }
public static bool FullScreen { get; set; }
static void Main(string[] args)
{
try
{
ProgramName = ConfigurationManager.AppSettings["ProgramName"];
MonitorNumber = Convert.ToInt32(ConfigurationManager.AppSettings["MonitorNumber"]);
MonitorName = ConfigurationManager.AppSettings["MonitorName"];
Width = Convert.ToInt32(ConfigurationManager.AppSettings["Width"]);
Height = Convert.ToInt32(ConfigurationManager.AppSettings["Height"]);
FullScreen = Convert.ToBoolean(ConfigurationManager.AppSettings["FullScreen"]);
processStartEvent.EventArrived += new EventArrivedEventHandler(processStartEvent_EventArrived);
processStartEvent.Start();
//processStopEvent.EventArrived += new EventArrivedEventHandler(processStopEvent_EventArrived);
//processStopEvent.Start();
HideConsole();
//Console.WriteLine("Press any Key to exit...");
//Console.ReadKey();
Application.Run();
}
catch (Exception ex)
{
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry(ex.Message, EventLogEntryType.Error, 101, 1);
}
}
}
static void processStartEvent_EventArrived(object sender, EventArrivedEventArgs e)
{
try
{
string processName = e.NewEvent.Properties["ProcessName"].Value.ToString();
if (processName.ToLower() == ProgramName.ToLower())
{
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry($"{ProgramName} started. Repositioning.", EventLogEntryType.Information, 101, 1);
}
int processID = Convert.ToInt32(e.NewEvent.Properties["ProcessID"].Value);
Process process = Process.GetProcessById(processID);
IntPtr ptr = process.MainWindowHandle;
Rect posRect = new Rect();
GetWindowRect(ptr, ref posRect);
Screen destinationMonitor;
if (!string.IsNullOrEmpty(MonitorName))
{
destinationMonitor = Screen.AllScreens.Where(f => f.DeviceName.ToLower() == MonitorName.ToLower()).First();
}
else
{
destinationMonitor = Screen.AllScreens[MonitorNumber - 1];
}
if(FullScreen)
{
MoveWindow(ptr, destinationMonitor.WorkingArea.X, destinationMonitor.WorkingArea.Y, destinationMonitor.WorkingArea.Width, destinationMonitor.WorkingArea.Height, true);
}
else
{
MoveWindow(ptr, destinationMonitor.WorkingArea.X, destinationMonitor.WorkingArea.Y, destinationMonitor.WorkingArea.Width, destinationMonitor.WorkingArea.Height, true);
MoveWindow(ptr, destinationMonitor.WorkingArea.X, destinationMonitor.WorkingArea.Y, Width, Height, true);
}
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry($"Finished repositioning {ProgramName} to monitor {MonitorNumber}.", EventLogEntryType.Information, 101, 1);
}
}
}
catch (Exception ex)
{
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry(ex.Message, EventLogEntryType.Error, 101, 1);
}
throw;
}
finally
{
e.NewEvent.Dispose();
}
}
static void processStopEvent_EventArrived(object sender, EventArrivedEventArgs e)
{
//Stop code
string processName = e.NewEvent.Properties["ProcessName"].Value.ToString();
if (processName.ToLower() == ProgramName.ToLower())
{
using (EventLog eventLog = new EventLog("Application"))
{
eventLog.Source = "Application";
eventLog.WriteEntry($"{ProgramName} closed.", EventLogEntryType.Information, 101, 1);
}
}
}
static void HideConsole()
{
IntPtr h = GetConsoleWindow();
if (h != IntPtr.Zero)
{
ShowWindow(h, 0);
}
}
}
}
| 39.011905 | 191 | 0.549435 | [
"MIT"
] | haseebfurkhan/AppPositioner | AppPositioner/Program.cs | 6,554 | C# |
using OneShot.com.ServiceReference1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HashPass;
namespace OneShot.com
{
public partial class Registerlaststep : System.Web.UI.Page
{
OneShotServiceClient client = new OneShotServiceClient();
protected void Page_Load(object sender, EventArgs e)
{
((index)Master).GetFooter.Visible = false;
((index)Master).GetTopHeader.Visible = false;
((index)Master).GetMiddleHeader.Visible = false;
error.Visible = false;
}
private bool upadateAddresss()
{
bool updated;
if (Province.Value != "Province")
{
string id = Session["ID"].ToString();
string address = stAddress.Value + ", " + complax.Value + ", " + suburb.Value + ", " + city.Value + ", " + Province.Value + ", " + postalcode.Value;
if (client.UpdateAddress(id,address))
{
updated = true;
}
else
{
updated = false;
error.InnerText = "Something went wrong , please try again";
error.Visible = true;
}
}
else
{
updated = false;
error.InnerText = "Select a province";
error.Visible = true;
}
return updated;
}
protected void btnNext_Click(object sender, EventArgs e)
{
//Gather all the user information , user address
//and register the user
//Redirect to sign in page
//update address
if (Request.QueryString["change"] != null)
{
if (this.upadateAddresss())
{
Response.Redirect("delivery.aspx");
}
}
else
{
string dateReg = DateTime.Now.ToString("d");
string address;
string emailaddress = Session["EmailAddress"].ToString();
string FName = Session["Firstname"].ToString();
string LName = Session["Lastname"].ToString();
string ID = Session["ID"].ToString();
string Contact = Session["ContactNumber"].ToString();
string password = Session["Password"].ToString();
if (Province.Value != "Province")
{
address = stAddress.Value + ", " + complax.Value + ", " + suburb.Value + ", " + city.Value + ", " + Province.Value + ", " + postalcode.Value;
if (client.RegisterUser(ID, FName, LName, emailaddress, Contact, city.Value, address, "Customer", Secrecy.HashPassword(password), dateReg))
{
string Month = DateTime.Now.ToString("MMM");
client.AddRegisteredUser(Month);
Session.RemoveAll();
Response.Redirect("Login.aspx");
}
else
{
error.InnerText = "Something went wrong , please try again";
error.Visible = true;
}
}
else
{
error.InnerText = "Select a province";
error.Visible = true;
}
}
}
}
} | 36.14 | 164 | 0.475374 | [
"Apache-2.0"
] | Miso-0/oneShot.com | OneShot.com/Registerlaststep.aspx.cs | 3,616 | C# |
/*
* Copyright (c) 2010-2015 Pivotal Software, Inc. 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. See accompanying
* LICENSE file.
*/
using System;
using System.Data;
using System.Data.Common;
using NUnit.Framework;
namespace Pivotal.Data.GemFireXD.Tests
{
/// <summary>
/// References Mono's SqlConnectionTest.GetSchemaTest for
/// System.Data.SqlClient though nearly all tests are different.
/// </summary>
[TestFixture]
public class GetSchemaTest : TestBase
{
private string[] m_commonTables = { "employee", "numeric_family",
"emp.credit" };
#region SetUp/TearDown methods
protected override string[] CommonTablesToCreate()
{
return m_commonTables;
}
protected override string[] GetTablesToDrop()
{
return new string[] { "emp.credit", "numeric_family", "employee" };
}
protected override string[] GetProceduresToDrop()
{
return new string[] { "test.sp_testproc" };
}
#endregion
#region Tests
[Test]
public void GetSchemaTest1()
{
int flag = 2;
DataTable tab1 = m_conn.GetSchema("Schemas");
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
if (col.ColumnName == "SCHEMA_NAME" && (row[col].ToString() == "APP"
|| row[col].ToString() == "EMP")) {
--flag;
break;
}
}
}
Assert.AreEqual(0, flag, "#GS1.1 failed");
// now test with restrictions
flag = 1;
tab1 = m_conn.GetSchema("Schemas", new string[] { null, "E%" });
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
if (col.ColumnName == "SCHEMA_NAME") {
if (row[col].ToString() == "EMP") {
// good case
--flag;
break;
}
else {
// bad case
Assert.Fail("#GS1.2 failed for schema: " + row[col]);
}
}
}
}
Assert.AreEqual(0, flag, "#GS1.3 failed");
}
[Test]
public void GetSchemaTest2()
{
try {
m_conn.GetSchema(null);
Assert.Fail("#GS2.1 expected ArgumentException");
} catch (ArgumentException) {
// expected exception
}
try {
m_conn.GetSchema("Mono");
Assert.Fail("#GS2.2 expected ArgumentException");
} catch (ArgumentException) {
// expected exception
}
}
[Test]
public void GetSchemaTest3()
{
int flag = 1;
DataTable tab1 = m_conn.GetSchema("ForeignKeys");
foreach (DataRow row in tab1.Rows) {
if (row["TABLE_NAME"].ToString() == "CREDIT") {
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS3.1 failed");
Assert.AreEqual("FK_EC", row["CONSTRAINT_NAME"], "#GS3.2 failed");
Assert.AreEqual("APP", row["PRIMARYKEY_TABLE_SCHEMA"],
"#GS3.3 failed");
Assert.AreEqual("EMPLOYEE", row["PRIMARYKEY_TABLE_NAME"],
"#GS3.4 failed");
Log("The primary key name is: " +
row["PRIMARYKEY_NAME"]);
--flag;
}
else {
Assert.Fail("#GS3.5 unexpected foreign key on table " +
row["TABLE_NAME"]);
}
}
Assert.AreEqual(0, flag, "#GS3.6 failed");
// now test with restrictions
flag = 1;
tab1 = m_conn.GetSchema("ForeignKeys", new string[] { null,
null, "CREDIT" });
foreach (DataRow row in tab1.Rows) {
if (row["TABLE_NAME"].ToString() == "CREDIT") {
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS3.7 failed");
Assert.AreEqual("FK_EC", row["CONSTRAINT_NAME"], "#GS3.8 failed");
Assert.AreEqual("APP", row["PRIMARYKEY_TABLE_SCHEMA"],
"#GS3.9 failed");
Assert.AreEqual("EMPLOYEE", row["PRIMARYKEY_TABLE_NAME"],
"#GS3.10 failed");
Log("The primary key name is: " +
row["PRIMARYKEY_NAME"]);
--flag;
}
else {
Assert.Fail("#GS3.11 unexpected foreign key on table " +
row["TABLE_NAME"]);
}
}
Assert.AreEqual(0, flag, "#GS3.12 failed");
}
[Test]
public void GetSchemaTest4()
{
int flag = 1;
DataTable tab1 = m_conn.GetSchema("ForeignKeyColumns");
foreach (DataRow row in tab1.Rows) {
if (row["TABLE_NAME"].ToString() == "CREDIT") {
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS4.1 failed");
Assert.AreEqual("FK_EC", row["CONSTRAINT_NAME"], "#GS4.2 failed");
Assert.AreEqual("APP", row["PRIMARYKEY_TABLE_SCHEMA"],
"#GS4.3 failed");
Assert.AreEqual("EMPLOYEE", row["PRIMARYKEY_TABLE_NAME"],
"#GS4.4 failed");
Assert.AreEqual("ID", row["PRIMARYKEY_COLUMN_NAME"],
"#GS4.5 failed");
Assert.AreEqual("EMPLOYEEID", row["COLUMN_NAME"], "#GS4.6 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS4.7 failed");
Log("The primary key name is: " +
row["PRIMARYKEY_NAME"]);
--flag;
}
else {
Assert.Fail("#GS4.8 unexpected foreign key on table " +
row["TABLE_NAME"]);
}
}
Assert.AreEqual(0, flag, "#GS4.9 failed");
// now test with restrictions
flag = 1;
tab1 = m_conn.GetSchema("ForeignKeyColumns", new string[]
{ null, "EMP", null });
foreach (DataRow row in tab1.Rows) {
if (row["TABLE_NAME"].ToString() == "CREDIT") {
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS4.10 failed");
Assert.AreEqual("FK_EC", row["CONSTRAINT_NAME"], "#GS4.11 failed");
Assert.AreEqual("APP", row["PRIMARYKEY_TABLE_SCHEMA"],
"#GS4.12 failed");
Assert.AreEqual("EMPLOYEE", row["PRIMARYKEY_TABLE_NAME"],
"#GS4.13 failed");
Assert.AreEqual("ID", row["PRIMARYKEY_COLUMN_NAME"],
"#GS4.14 failed");
Assert.AreEqual("EMPLOYEEID", row["COLUMN_NAME"], "#GS4.15 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS4.16 failed");
--flag;
}
else {
Assert.Fail("#GS4.17 unexpected foreign key on table " +
row["TABLE_NAME"]);
}
}
Assert.AreEqual(0, flag, "#GS4.18 failed");
}
[Test]
public void GetSchemaTest5()
{
int credFlag = 2, empFlag = 1, numFlag = 1;
DataTable tab1 = m_conn.GetSchema("Indexes");
foreach (DataRow row in tab1.Rows) {
switch (row["TABLE_NAME"].ToString()) {
case "EMPLOYEE": --empFlag; break;
case "CREDIT": --credFlag; break;
case "NUMERIC_FAMILY": --numFlag; break;
default:
Assert.Fail("#GS5.1 unexpected index on table " +
row["TABLE_NAME"]);
break;
}
}
Assert.AreEqual(0, empFlag, "#GS5.2 failed");
Assert.AreEqual(0, credFlag, "#GS5.3 failed");
Assert.AreEqual(0, numFlag, "#GS5.4 failed");
// now test with restrictions
credFlag = 2;
tab1 = m_conn.GetSchema("Indexes", new string[]
{ null, "EMP", "CREDIT" } );
foreach (DataRow row in tab1.Rows) {
if (row["TABLE_NAME"].ToString() == "CREDIT") {
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS5.5 failed");
Assert.AreEqual("A", row["SORT_TYPE"], "#GS5.6 failed");
--credFlag;
}
else {
Assert.Fail("#GS5.7 unexpected index on table " +
row["TABLE_NAME"]);
}
}
Assert.AreEqual(0, credFlag, "#GS5.8 failed");
}
[Test]
public void GetSchemaTest6()
{
int credFlag = 2, empFlag = 1, numFlag = 1;
DataTable tab1 = m_conn.GetSchema("IndexColumns");
foreach (DataRow row in tab1.Rows) {
switch (row["TABLE_NAME"].ToString()) {
case "EMPLOYEE":
Assert.AreEqual("ID", row["COLUMN_NAME"], "#GS6.1 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS6.2 failed");
Assert.AreEqual("A", row["SORT_TYPE"], "#GS6.3 failed");
--empFlag;
break;
case "CREDIT":
Assert.IsTrue(row["COLUMN_NAME"].ToString() == "EMPLOYEEID" ||
row["COLUMN_NAME"].ToString() == "CREDITID",
"#GS6.4 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS6.5 failed");
Assert.AreEqual("A", row["SORT_TYPE"], "#GS6.6 failed");
--credFlag;
break;
case "NUMERIC_FAMILY":
Assert.AreEqual("ID", row["COLUMN_NAME"], "#GS6.7 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS6.8 failed");
Assert.AreEqual("A", row["SORT_TYPE"], "#GS6.9 failed");
--numFlag;
break;
default:
Assert.Fail("#GS6.10 unexpected index on table " +
row["TABLE_NAME"]);
break;
}
}
Assert.AreEqual(0, empFlag, "#GS6.11 failed");
Assert.AreEqual(0, credFlag, "#GS6.12 failed");
Assert.AreEqual(0, numFlag, "#GS6.13 failed");
// now test with restrictions
credFlag = 2;
tab1 = m_conn.GetSchema("IndexColumns", new string[]
{ null, null, "CREDIT" } );
foreach (DataRow row in tab1.Rows) {
Assert.AreEqual("CREDIT", row["TABLE_NAME"].ToString(),
"#GS6.14 failed");
Assert.AreEqual("EMP", row["TABLE_SCHEMA"].ToString(),
"#GS6.15 failed");
Assert.IsTrue(row["COLUMN_NAME"].ToString() == "EMPLOYEEID" ||
row["COLUMN_NAME"].ToString() == "CREDITID",
"#GS6.16 failed");
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS6.17 failed");
Assert.AreEqual("A", row["SORT_TYPE"], "#GS6.18 failed");
--credFlag;
}
Assert.AreEqual(0, credFlag, "#GS6.19 failed");
}
[Test]
public void GetSchemaTest7()
{
// create a procedure
string create_sp = "CREATE PROCEDURE test.sp_testproc" +
" (inout decval decimal(29, 0), id int, out name varchar(100))" +
" language java parameter style java" +
" external name 'tests.TestProcedures.testproc'";
using (m_cmd = m_conn.CreateCommand()) {
m_cmd.CommandText = create_sp;
m_cmd.ExecuteNonQuery();
}
int flag = 1;
DataTable tab1 = m_conn.GetSchema("Procedures");
foreach (DataRow row in tab1.Rows) {
if (row["PROCEDURE_SCHEMA"].ToString() == "TEST") {
Assert.AreEqual("SP_TESTPROC", row["PROCEDURE_NAME"],
"#GS7.1 failed");
Assert.AreEqual("NO_RESULT", row["PROCEDURE_RESULT_TYPE"],
"GS7.2 failed");
--flag;
}
else {
Assert.IsTrue(row["PROCEDURE_SCHEMA"].ToString().StartsWith("SYS") ||
row["PROCEDURE_SCHEMA"].ToString().StartsWith("SQLJ"),
"#GS7.3 failed");
}
}
Assert.AreEqual(0, flag, "#GS7.4 failed");
// now test with restrictions
flag = 1;
tab1 = m_conn.GetSchema("Procedures", new string[]
{ null, "T%", "%SP%" });
foreach (DataRow row in tab1.Rows) {
if (row["PROCEDURE_SCHEMA"].ToString() == "TEST") {
Assert.AreEqual("SP_TESTPROC", row["PROCEDURE_NAME"],
"#GS7.5 failed");
Assert.AreEqual("NO_RESULT", row["PROCEDURE_RESULT_TYPE"],
"GS7.6 failed");
--flag;
}
else {
Assert.Fail("#GS7.7 failed");
}
}
Assert.AreEqual(0, flag, "#GS7.8 failed");
}
[Test]
public void GetSchemaTest8()
{
// create a procedure
string create_sp = "CREATE PROCEDURE test.sp_testproc" +
" (inout decval decimal(29, 0), id int, out name varchar(100))" +
" language java parameter style java" +
" external name 'tests.TestProcedures.testproc'";
using (m_cmd = m_conn.CreateCommand()) {
m_cmd.CommandText = create_sp;
m_cmd.ExecuteNonQuery();
}
int flag = 3;
DataTable tab1 = m_conn.GetSchema("ProcedureParameters");
foreach (DataRow row in tab1.Rows) {
if (row["PROCEDURE_SCHEMA"].ToString() == "TEST") {
string paramName = row["PARAMETER_NAME"].ToString();
Assert.AreEqual("SP_TESTPROC", row["PROCEDURE_NAME"],
"#GS8.1 failed");
Assert.AreEqual(DBNull.Value, row["PROCEDURE_CATALOG"],
"#GS8.2 failed");
switch (paramName) {
case "DECVAL":
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS8.3 failed");
Assert.AreEqual("INOUT", row["PARAMETER_MODE"], "#GS8.4 failed");
Assert.AreEqual("DECIMAL", row["TYPE_NAME"], "#GS8.5 failed");
Assert.AreEqual(62, row["COLUMN_SIZE"], "GS8.6 failed");
Assert.AreEqual(29, row["PRECISION"], "GS8.7 failed");
Assert.AreEqual(0, row["SCALE"], "GS8.8 failed");
Assert.AreEqual(10, row["PRECISION_RADIX"], "GS8.9 failed");
Assert.AreEqual(DBNull.Value, row["CHARACTER_OCTET_LENGTH"],
"GS8.10 failed");
Assert.AreEqual("YES", row["IS_NULLABLE"], "GS8.11 failed");
break;
case "ID":
Assert.AreEqual(2, row["ORDINAL_POSITION"], "#GS8.12 failed");
Assert.AreEqual("IN", row["PARAMETER_MODE"], "#GS8.13 failed");
Assert.AreEqual("INTEGER", row["TYPE_NAME"], "#GS8.14 failed");
Assert.AreEqual(4, row["COLUMN_SIZE"], "GS8.15 failed");
Assert.AreEqual(10, row["PRECISION"], "GS8.16 failed");
Assert.AreEqual(0, row["SCALE"], "GS8.17 failed");
Assert.AreEqual(10, row["PRECISION_RADIX"], "GS8.18 failed");
Assert.AreEqual(DBNull.Value, row["CHARACTER_OCTET_LENGTH"],
"GS8.19 failed");
Assert.AreEqual("YES", row["IS_NULLABLE"], "GS8.20 failed");
break;
case "NAME":
Assert.AreEqual(3, row["ORDINAL_POSITION"], "#GS8.21 failed");
Assert.AreEqual("OUT", row["PARAMETER_MODE"], "#GS8.22 failed");
Assert.AreEqual("VARCHAR", row["TYPE_NAME"], "#GS8.23 failed");
Assert.AreEqual(200, row["COLUMN_SIZE"], "GS8.24 failed");
Assert.AreEqual(100, row["PRECISION"], "GS8.25 failed");
Assert.AreEqual(DBNull.Value, row["SCALE"], "GS8.26 failed");
Assert.AreEqual(DBNull.Value, row["PRECISION_RADIX"],
"GS8.27 failed");
Assert.AreEqual(200, row["CHARACTER_OCTET_LENGTH"],
"GS8.28 failed");
Assert.AreEqual("YES", row["IS_NULLABLE"], "GS8.29 failed");
break;
default:
Assert.Fail("#GS8.30 unknown parameter: " + paramName);
break;
}
--flag;
}
else {
Assert.IsTrue(row["PROCEDURE_SCHEMA"].ToString().StartsWith("SYS") ||
row["PROCEDURE_SCHEMA"].ToString().StartsWith("SQLJ"),
"#GS8.31 failed");
}
}
Assert.AreEqual(0, flag, "#GS8.32 failed");
// now test with restrictions
flag = 1;
tab1 = m_conn.GetSchema("ProcedureParameters", new string[]
{ null, null, null, "DEC%" });
foreach (DataRow row in tab1.Rows) {
if (row["PROCEDURE_SCHEMA"].ToString() == "TEST") {
string paramName = row["PARAMETER_NAME"].ToString();
Assert.AreEqual("SP_TESTPROC", row["PROCEDURE_NAME"],
"#GS8.33 failed");
Assert.AreEqual(DBNull.Value, row["PROCEDURE_CATALOG"],
"#GS8.34 failed");
switch (paramName) {
case "DECVAL":
Assert.AreEqual(1, row["ORDINAL_POSITION"], "#GS8.35 failed");
Assert.AreEqual("INOUT", row["PARAMETER_MODE"], "#GS8.36 failed");
Assert.AreEqual("DECIMAL", row["TYPE_NAME"], "#GS8.37 failed");
Assert.AreEqual(62, row["COLUMN_SIZE"], "GS8.38 failed");
Assert.AreEqual(29, row["PRECISION"], "GS8.39 failed");
Assert.AreEqual(0, row["SCALE"], "GS8.40 failed");
Assert.AreEqual(10, row["PRECISION_RADIX"], "GS8.41 failed");
Assert.AreEqual(DBNull.Value, row["CHARACTER_OCTET_LENGTH"],
"GS8.42 failed");
Assert.AreEqual("YES", row["IS_NULLABLE"], "GS8.43 failed");
break;
default:
Assert.Fail("#GS8.44 unknown parameter: " + paramName);
break;
}
--flag;
}
else {
Assert.Fail("#GS8.45 failed");
}
}
Assert.AreEqual(0, flag, "#GS8.46 failed");
}
[Test]
public void GetSchemaTest9()
{
int flag = 3;
DataTable tab1 = m_conn.GetSchema("Tables");
foreach (DataRow row in tab1.Rows) {
switch (row["TABLE_NAME"].ToString()) {
case "EMPLOYEE":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.1");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS9.2");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.3");
--flag;
break;
case "CREDIT":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.4");
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS9.5");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.6");
--flag;
break;
case "NUMERIC_FAMILY":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.7");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS9.8");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.9");
--flag;
break;
}
}
Assert.AreEqual(0, flag, "#GS9.10");
// now test with restrictions
flag = 3;
tab1 = m_conn.GetSchema("Tables", new string[]
{ null, null, "%", "TABLE" });
foreach (DataRow row in tab1.Rows) {
switch (row["TABLE_NAME"].ToString()) {
case "EMPLOYEE":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.11");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS9.12");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.13");
--flag;
break;
case "CREDIT":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.14");
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS9.15");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.16");
--flag;
break;
case "NUMERIC_FAMILY":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS9.17");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS9.18");
Assert.AreEqual("TABLE", row["TABLE_TYPE"], "#GS9.19");
--flag;
break;
default:
Assert.Fail("#GS9.20 unexpected table: " + row["TABLE_NAME"]);
break;
}
}
Assert.AreEqual(0, flag, "#GS9.21");
}
[Test]
public void GetSchemaTest10()
{
int flag = 12;
DataTable tab1 = m_conn.GetSchema("Columns");
foreach (DataRow row in tab1.Rows) {
switch (row["TABLE_NAME"].ToString()) {
case "EMPLOYEE":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS10.1");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS10.2");
--flag;
break;
case "CREDIT":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS10.4");
Assert.AreEqual("EMP", row["TABLE_SCHEMA"], "#GS10.5");
--flag;
break;
case "NUMERIC_FAMILY":
Assert.AreEqual("", row["TABLE_CATALOG"], "#GS10.7");
Assert.AreEqual("APP", row["TABLE_SCHEMA"], "#GS10.8");
--flag;
break;
}
}
Assert.AreEqual(0, flag, "#GS10.10");
}
//[Test]
public void GetSchemaTest11()
{
bool flag = false;
DataTable tab1 = m_conn.GetSchema("Views");
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
/*
* TODO: We need to consider multiple values.
*/
if (col.ColumnName.ToString() == "user_name"
&& row[col].ToString() == "public") {
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS11 failed");
}
[Test]
public void GetSchemaTest12()
{
bool flag = false;
DataTable tab1 = m_conn.GetSchema();
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
/*
* TODO: We need to consider multiple values
*/
if (col.ColumnName.ToString() == "CollectionName"
&& row[col].ToString() == "Tables") {
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS12 failed");
}
[Test]
public void GetSchemaTest13()
{
bool flag = false;
DataTable tab1 = m_conn.GetSchema("RESTRICTIONS");
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
/*
* TODO: We need to consider multiple values
*/
if (col.ColumnName.ToString() == "RestrictionDefault"
&& row[col].ToString() == "FUNCTION_NAME") {
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS13 failed");
}
[Test]
public void GetSchemaTest14()
{
string[] restrictions = new string[1];
try {
m_conn.GetSchema("RESTRICTIONS", restrictions);
Assert.Fail("#G16 expected exception");
} catch (ArgumentException) {
// expected exception
}
}
[Test]
public void GetSchemaTest15()
{
bool flag = false;
DataTable tab1 = m_conn.GetSchema("DataTypes");
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
/*
* TODO: We need to consider multiple values
*/
if (col.ColumnName.ToString() == "TypeName"
&& row[col].ToString() == "DECIMAL") {
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS15 failed");
}
[Test]
public void GetSchemaTest16()
{
bool flag = false;
DataTable tab1 = m_conn.GetSchema("ReservedWords");
foreach (DataRow row in tab1.Rows) {
foreach (DataColumn col in tab1.Columns) {
/*
* We need to consider multiple values
*/
if (col.ColumnName.ToString() == "ReservedWord"
&& row[col].ToString() == "UPPER") {
flag = true;
break;
}
}
if (flag)
break;
}
Assert.AreEqual(true, flag, "#GS16 failed");
}
[Test]
public void GetSchemaTest17()
{
string[] restrictions = new string[1];
try {
m_conn.GetSchema("Mono", restrictions);
Assert.Fail("#GS17 expected exception");
} catch (ArgumentException) {
// expected exception
}
}
#endregion
}
}
| 35.81241 | 80 | 0.519703 | [
"Apache-2.0"
] | gemxd/gemfirexd-oss | gemfirexd/client/test/csharp/ado-tests/GetSchemaTest.cs | 24,818 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Attendence_System
{
class StudentRegistrationModel
{
private int batchid;
private string rollno;
private string name;
private string fname;
private string surname;
private string address;
private string email;
private string mobieNo;
private string password;
private string gender;
public int Batchid {
get
{
return batchid;
}
set { batchid = value; }
}
public string RollNo {
get { return rollno; }
set { rollno = value; }
}
public string Gender {
get { return gender; }
set { gender = value; }
}
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
public string Fname
{
get
{
return fname;
}
set
{
fname = value;
}
}
public string SurName
{
get
{
return surname;
}
set
{
surname = value;
}
}
public string Address
{
get { return address; }
set { address = value; }
}
public string Email
{
get { return email; }
set { email = value; }
}
public string MobileNo
{
get { return mobieNo; }
set { mobieNo = value; }
}
public string Pass
{
get { return password; }
set { password = value; }
}
public override string ToString()
{
return rollno;
}
}
}
| 21.68 | 42 | 0.391605 | [
"MIT"
] | jahanzeb-j/Attendance-Management-System | Attendence System/Attendence System/StudentRegistrationModel.cs | 2,170 | C# |
using System;
namespace SiaqodbCloudService.Areas.HelpPage
{
/// <summary>
/// This represents an invalid sample on the help page. There's a display template named InvalidSample associated with this class.
/// </summary>
public class InvalidSample
{
public InvalidSample(string errorMessage)
{
if (errorMessage == null)
{
throw new ArgumentNullException("errorMessage");
}
ErrorMessage = errorMessage;
}
public string ErrorMessage { get; private set; }
public override bool Equals(object obj)
{
InvalidSample other = obj as InvalidSample;
return other != null && ErrorMessage == other.ErrorMessage;
}
public override int GetHashCode()
{
return ErrorMessage.GetHashCode();
}
public override string ToString()
{
return ErrorMessage;
}
}
} | 26.513514 | 134 | 0.579001 | [
"Apache-2.0"
] | morecraf/SiaqodbCloud-Service | src/Areas/HelpPage/SampleGeneration/InvalidSample.cs | 981 | 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.Generic;
using System.Globalization;
using System.Linq;
using System.Management.Automation;
using System.Threading;
using System.Xml;
using Microsoft.Azure.Commands.Insights.OutputClasses;
using Microsoft.Azure.Management.Monitor.Management;
using Microsoft.Azure.Management.Monitor.Management.Models;
namespace Microsoft.Azure.Commands.Insights.Diagnostics
{
/// <summary>
/// Get the list of events for at a subscription level.
/// </summary>
[Cmdlet(VerbsCommon.Set, "AzureRmDiagnosticSetting", SupportsShouldProcess = true), OutputType(typeof(PSServiceDiagnosticSettings))]
public class SetAzureRmDiagnosticSettingCommand : ManagementCmdletBase
{
public const string StorageAccountIdParamName = "StorageAccountId";
public const string ServiceBusRuleIdParamName = "ServiceBusRuleId";
public const string EventHubRuleIdParamName = "EventHubAuthorizationRuleId";
public const string WorkspacetIdParamName = "WorkspaceId";
public const string EnabledParamName = "Enabled";
#region Parameters declarations
/// <summary>
/// Gets or sets the resourceId parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource id")]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
/// <summary>
/// Gets or sets the storage account parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The storage account id")]
public string StorageAccountId { get; set; }
/// <summary>
/// Gets or sets the service bus rule id parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The service bus rule id")]
public string ServiceBusRuleId { get; set; }
/// <summary>
/// Gets or sets the event hub authorization rule id parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The event hub rule id")]
public string EventHubAuthorizationRuleId { get; set; }
/// <summary>
/// Gets or sets the enable parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The value indicating whether the diagnostics should be enabled or disabled")]
[ValidateNotNullOrEmpty]
public bool Enabled { get; set; }
/// <summary>
/// Gets or sets the categories parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The log categories")]
[ValidateNotNullOrEmpty]
public List<string> Categories { get; set; }
/// <summary>
/// Gets or sets the timegrain parameter of the cmdlet
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The timegrains")]
[ValidateNotNullOrEmpty]
public List<string> Timegrains { get; set; }
/// <summary>
/// Gets or sets a value indicating whether retention should be enabled
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The value indicating whether the retention should be enabled")]
[ValidateNotNullOrEmpty]
public bool? RetentionEnabled { get; set; }
/// <summary>
/// Gets or sets the OMS workspace Id
/// </summary>
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource Id of the Log Analytics workspace to send logs/metrics to")]
public string WorkspaceId { get; set; }
/// <summary>
/// Gets or sets the retention in days
/// </summary>
[Parameter(ValueFromPipelineByPropertyName = true, HelpMessage = "The retention in days.")]
public int? RetentionInDays { get; set; }
#endregion
private bool isStorageParamPresent;
private bool isServiceBusParamPresent;
private bool isEventHubRuleParamPresent;
private bool isWorkspaceParamPresent;
private bool isEnbledParameterPresent;
protected override void ProcessRecordInternal()
{
HashSet<string> usedParams = new HashSet<string>(this.MyInvocation.BoundParameters.Keys, StringComparer.OrdinalIgnoreCase);
this.isStorageParamPresent = usedParams.Contains(StorageAccountIdParamName);
this.isServiceBusParamPresent = usedParams.Contains(ServiceBusRuleIdParamName);
this.isEventHubRuleParamPresent = usedParams.Contains(EventHubRuleIdParamName);
this.isWorkspaceParamPresent = usedParams.Contains(WorkspacetIdParamName);
this.isEnbledParameterPresent = usedParams.Contains(EnabledParamName);
if (!this.isStorageParamPresent &&
!this.isServiceBusParamPresent &&
!this.isEventHubRuleParamPresent &&
!this.isWorkspaceParamPresent &&
!this.isEnbledParameterPresent)
{
throw new ArgumentException("No operation is specified");
}
ServiceDiagnosticSettingsResource getResponse = this.MonitorManagementClient.ServiceDiagnosticSettings.GetAsync(resourceUri: this.ResourceId, cancellationToken: CancellationToken.None).Result;
ServiceDiagnosticSettingsResource properties = getResponse;
SetStorage(properties);
SetServiceBus(properties);
SetEventHubRule(properties);
SetWorkspace(properties);
if (this.Categories == null && this.Timegrains == null)
{
SetAllCategoriesAndTimegrains(properties);
}
else
{
if (this.Categories != null)
{
SetSelectedCategories(properties);
}
if (this.Timegrains != null)
{
SetSelectedTimegrains(properties);
}
}
if (this.RetentionEnabled.HasValue)
{
SetRetention(properties);
}
var putParameters = CopySettings(properties);
if (ShouldProcess(
target: string.Format("Create/update a diagnostic setting for resource Id: {0}", this.ResourceId),
action: "Create/update a diagnostic setting"))
{
ServiceDiagnosticSettingsResource result = this.MonitorManagementClient.ServiceDiagnosticSettings.CreateOrUpdateAsync(resourceUri: this.ResourceId, parameters: putParameters, cancellationToken: CancellationToken.None).Result;
WriteObject(new PSServiceDiagnosticSettings(result));
}
}
private static ServiceDiagnosticSettingsResource CopySettings(ServiceDiagnosticSettingsResource properties)
{
// Location is marked as required, but the get operation returns Location as null. So use an empty string instead of null to avoid validation errors
var putParameters = new ServiceDiagnosticSettingsResource(location: properties.Location ?? string.Empty, name: properties.Name, id: properties.Id, type: properties.Type)
{
Logs = properties.Logs,
Metrics = properties.Metrics,
ServiceBusRuleId = properties.ServiceBusRuleId,
StorageAccountId = properties.StorageAccountId,
WorkspaceId = properties.WorkspaceId,
Tags = properties.Tags,
EventHubAuthorizationRuleId = properties.EventHubAuthorizationRuleId
};
return putParameters;
}
private void SetRetention(ServiceDiagnosticSettingsResource properties)
{
var retentionPolicy = new RetentionPolicy
{
Enabled = this.RetentionEnabled.Value,
Days = this.RetentionInDays.Value
};
if (properties.Logs != null)
{
foreach (LogSettings logSettings in properties.Logs)
{
logSettings.RetentionPolicy = retentionPolicy;
}
}
if (properties.Metrics != null)
{
foreach (MetricSettings metricSettings in properties.Metrics)
{
metricSettings.RetentionPolicy = retentionPolicy;
}
}
}
private void SetSelectedTimegrains(ServiceDiagnosticSettingsResource properties)
{
if (!this.isEnbledParameterPresent)
{
throw new ArgumentException("Parameter 'Enabled' is required by 'Timegrains' parameter.");
}
foreach (string timegrainString in this.Timegrains)
{
TimeSpan timegrain = XmlConvert.ToTimeSpan(timegrainString);
MetricSettings metricSettings = properties.Metrics.FirstOrDefault(x => TimeSpan.Equals(x.TimeGrain, timegrain));
if (metricSettings == null)
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Metric timegrain '{0}' is not available", timegrainString));
}
metricSettings.Enabled = this.Enabled;
}
}
private void SetSelectedCategories(ServiceDiagnosticSettingsResource properties)
{
if (!this.isEnbledParameterPresent)
{
throw new ArgumentException("Parameter 'Enabled' is required by 'Categories' parameter.");
}
foreach (string category in this.Categories)
{
LogSettings logSettings = properties.Logs.FirstOrDefault(x => string.Equals(x.Category, category, StringComparison.OrdinalIgnoreCase));
if (logSettings == null)
{
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Log category '{0}' is not available", category));
}
logSettings.Enabled = this.Enabled;
}
}
private void SetAllCategoriesAndTimegrains(ServiceDiagnosticSettingsResource properties)
{
if (!this.isEnbledParameterPresent)
{
return;
}
foreach (var log in properties.Logs)
{
log.Enabled = this.Enabled;
}
foreach (var metric in properties.Metrics)
{
metric.Enabled = this.Enabled;
}
}
private void SetWorkspace(ServiceDiagnosticSettingsResource properties)
{
if (this.isWorkspaceParamPresent)
{
properties.WorkspaceId = this.WorkspaceId;
}
}
private void SetServiceBus(ServiceDiagnosticSettingsResource properties)
{
if (this.isServiceBusParamPresent)
{
properties.ServiceBusRuleId = this.ServiceBusRuleId;
}
}
private void SetEventHubRule(ServiceDiagnosticSettingsResource properties)
{
if (this.isEventHubRuleParamPresent)
{
properties.EventHubAuthorizationRuleId = this.EventHubAuthorizationRuleId;
}
}
private void SetStorage(ServiceDiagnosticSettingsResource properties)
{
if (this.isStorageParamPresent)
{
properties.StorageAccountId = this.StorageAccountId;
}
}
}
}
| 41.316456 | 242 | 0.606464 | [
"MIT"
] | AzureDataBox/azure-powershell | src/ResourceManager/Insights/Commands.Insights/Diagnostics/SetAzureRmDiagnosticSettingCommand.cs | 12,743 | C# |
// <auto-generated>
//
// Generated by
// _ _
// /\/\ __ _ _ __ | |__ __ _ ___ ___ ___| |_
// / \ / _` | '_ \| '_ \ / _` / __/ __|/ _ \ __|
// / /\/\ \ (_| | | | | | | | (_| \__ \__ \ __/ |_
// \/ \/\__,_|_| |_|_| |_|\__,_|___/___/\___|\__| v 2.0.0
//
// <copyright file="DeviceEnrollmentRepository.cs" company="Arm">
// Copyright (c) Arm. All rights reserved.
// </copyright>
// </auto-generated>
namespace Mbed.Cloud.Foundation
{
using Mbed.Cloud.Common;
using System.Threading.Tasks;
using MbedCloudSDK.Exceptions;
using System.Collections.Generic;
using System;
using Mbed.Cloud.RestClient;
/// <summary>
/// DeviceEnrollmentRepository
/// </summary>
public class DeviceEnrollmentRepository : Repository, IDeviceEnrollmentRepository
{
public DeviceEnrollmentRepository()
{
}
public DeviceEnrollmentRepository(Config config, Client client = null) : base(config, client)
{
}
public async Task<DeviceEnrollment> Create(DeviceEnrollment request)
{
try
{
var bodyParams = new DeviceEnrollment { EnrollmentIdentity = request.EnrollmentIdentity, };
return await Client.CallApi<DeviceEnrollment>(path: "/v3/device-enrollments", bodyParams: bodyParams, objectToUnpack: request, method: HttpMethods.POST);
}
catch (ApiException e)
{
throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent);
}
}
public async Task Delete(string id)
{
try
{
var pathParams = new Dictionary<string, object> { { "id", id }, };
await Client.CallApi<DeviceEnrollment>(path: "/v3/device-enrollments/{id}", pathParams: pathParams, method: HttpMethods.DELETE);
}
catch (ApiException e)
{
throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent);
}
}
public PaginatedResponse<IDeviceEnrollmentListOptions, DeviceEnrollment> List(IDeviceEnrollmentListOptions options = null)
{
try
{
if (options == null)
{
options = new DeviceEnrollmentListOptions();
}
Func<IDeviceEnrollmentListOptions, Task<ResponsePage<DeviceEnrollment>>> paginatedFunc = async (IDeviceEnrollmentListOptions _options) => { var queryParams = new Dictionary<string, object> { { "after", _options.After }, { "include", _options.Include }, { "limit", _options.Limit }, { "order", _options.Order }, }; return await Client.CallApi<ResponsePage<DeviceEnrollment>>(path: "/v3/device-enrollments", queryParams: queryParams, method: HttpMethods.GET); };
return new PaginatedResponse<IDeviceEnrollmentListOptions, DeviceEnrollment>(paginatedFunc, options);
}
catch (ApiException e)
{
throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent);
}
}
public async Task<DeviceEnrollment> Read(string id)
{
try
{
var pathParams = new Dictionary<string, object> { { "id", id }, };
return await Client.CallApi<DeviceEnrollment>(path: "/v3/device-enrollments/{id}", pathParams: pathParams, method: HttpMethods.GET);
}
catch (ApiException e)
{
throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent);
}
}
}
} | 39.074468 | 476 | 0.575007 | [
"Apache-2.0"
] | ARMmbed/mbed-cloud-sdk-dotnet | src/SDK/Foundation/Devices/DeviceEnrollment/DeviceEnrollmentRepository.cs | 3,673 | 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 cognito-idp-2016-04-18.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using Amazon.CognitoIdentityProvider.Model;
using Amazon.CognitoIdentityProvider.Model.Internal.MarshallTransformations;
using Amazon.CognitoIdentityProvider.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.CognitoIdentityProvider
{
/// <summary>
/// Implementation for accessing CognitoIdentityProvider
///
/// Using the Amazon Cognito User Pools API, you can create a user pool to manage directories
/// and users. You can authenticate a user to obtain tokens related to user identity and
/// access policies.
///
///
/// <para>
/// This API reference provides information about user pools in Amazon Cognito User Pools.
/// </para>
///
/// <para>
/// For more information, see the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html">Amazon
/// Cognito Documentation</a>.
/// </para>
/// </summary>
public partial class AmazonCognitoIdentityProviderClient : AmazonServiceClient, IAmazonCognitoIdentityProvider
{
private static IServiceMetadata serviceMetadata = new AmazonCognitoIdentityProviderMetadata();
#if BCL45 || AWS_ASYNC_ENUMERABLES_API
private ICognitoIdentityProviderPaginatorFactory _paginators;
/// <summary>
/// Paginators for the service
/// </summary>
public ICognitoIdentityProviderPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new CognitoIdentityProviderPaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#region Constructors
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
public AmazonCognitoIdentityProviderClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCognitoIdentityProviderConfig()) { }
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="region">The region to connect.</param>
public AmazonCognitoIdentityProviderClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonCognitoIdentityProviderConfig{RegionEndpoint = region}) { }
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
/// <code>
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
/// </code>
///
/// </summary>
/// <param name="config">The AmazonCognitoIdentityProviderClient Configuration Object</param>
public AmazonCognitoIdentityProviderClient(AmazonCognitoIdentityProviderConfig config)
: base(FallbackCredentialsFactory.GetCredentials(), config) { }
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
public AmazonCognitoIdentityProviderClient(AWSCredentials credentials)
: this(credentials, new AmazonCognitoIdentityProviderConfig())
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with AWS Credentials
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="region">The region to connect.</param>
public AmazonCognitoIdentityProviderClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonCognitoIdentityProviderConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with AWS Credentials and an
/// AmazonCognitoIdentityProviderClient Configuration object.
/// </summary>
/// <param name="credentials">AWS Credentials</param>
/// <param name="clientConfig">The AmazonCognitoIdentityProviderClient Configuration Object</param>
public AmazonCognitoIdentityProviderClient(AWSCredentials credentials, AmazonCognitoIdentityProviderConfig clientConfig)
: base(credentials, clientConfig)
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient 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 AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCognitoIdentityProviderConfig())
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient 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 AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonCognitoIdentityProviderConfig() {RegionEndpoint=region})
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCognitoIdentityProviderClient Configuration object.
/// </summary>
/// <param name="awsAccessKeyId">AWS Access Key ID</param>
/// <param name="awsSecretAccessKey">AWS Secret Access Key</param>
/// <param name="clientConfig">The AmazonCognitoIdentityProviderClient Configuration Object</param>
public AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonCognitoIdentityProviderConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient 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 AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCognitoIdentityProviderConfig())
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient 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 AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonCognitoIdentityProviderConfig{RegionEndpoint = region})
{
}
/// <summary>
/// Constructs AmazonCognitoIdentityProviderClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonCognitoIdentityProviderClient 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 AmazonCognitoIdentityProviderClient Configuration Object</param>
public AmazonCognitoIdentityProviderClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonCognitoIdentityProviderConfig 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 AddCustomAttributes
/// <summary>
/// Adds additional user attributes to the user pool schema.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AddCustomAttributes service method.</param>
///
/// <returns>The response from the AddCustomAttributes service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserImportInProgressException">
/// This exception is thrown when you are trying to modify a user pool while a user import
/// job is in progress for that pool.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes">REST API Reference for AddCustomAttributes Operation</seealso>
public virtual AddCustomAttributesResponse AddCustomAttributes(AddCustomAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AddCustomAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AddCustomAttributesResponseUnmarshaller.Instance;
return Invoke<AddCustomAttributesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AddCustomAttributes operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AddCustomAttributes operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAddCustomAttributes
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes">REST API Reference for AddCustomAttributes Operation</seealso>
public virtual IAsyncResult BeginAddCustomAttributes(AddCustomAttributesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AddCustomAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AddCustomAttributesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AddCustomAttributes operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAddCustomAttributes.</param>
///
/// <returns>Returns a AddCustomAttributesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes">REST API Reference for AddCustomAttributes Operation</seealso>
public virtual AddCustomAttributesResponse EndAddCustomAttributes(IAsyncResult asyncResult)
{
return EndInvoke<AddCustomAttributesResponse>(asyncResult);
}
#endregion
#region AdminAddUserToGroup
/// <summary>
/// Adds the specified user to the specified group.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminAddUserToGroup service method.</param>
///
/// <returns>The response from the AdminAddUserToGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup">REST API Reference for AdminAddUserToGroup Operation</seealso>
public virtual AdminAddUserToGroupResponse AdminAddUserToGroup(AdminAddUserToGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminAddUserToGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminAddUserToGroupResponseUnmarshaller.Instance;
return Invoke<AdminAddUserToGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminAddUserToGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminAddUserToGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminAddUserToGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup">REST API Reference for AdminAddUserToGroup Operation</seealso>
public virtual IAsyncResult BeginAdminAddUserToGroup(AdminAddUserToGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminAddUserToGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminAddUserToGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminAddUserToGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminAddUserToGroup.</param>
///
/// <returns>Returns a AdminAddUserToGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup">REST API Reference for AdminAddUserToGroup Operation</seealso>
public virtual AdminAddUserToGroupResponse EndAdminAddUserToGroup(IAsyncResult asyncResult)
{
return EndInvoke<AdminAddUserToGroupResponse>(asyncResult);
}
#endregion
#region AdminConfirmSignUp
/// <summary>
/// Confirms user registration as an admin without using a confirmation code. Works on
/// any user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminConfirmSignUp service method.</param>
///
/// <returns>The response from the AdminConfirmSignUp service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyFailedAttemptsException">
/// This exception is thrown when the user has made too many failed attempts for a given
/// action (e.g., sign in).
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp">REST API Reference for AdminConfirmSignUp Operation</seealso>
public virtual AdminConfirmSignUpResponse AdminConfirmSignUp(AdminConfirmSignUpRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminConfirmSignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminConfirmSignUpResponseUnmarshaller.Instance;
return Invoke<AdminConfirmSignUpResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminConfirmSignUp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminConfirmSignUp operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminConfirmSignUp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp">REST API Reference for AdminConfirmSignUp Operation</seealso>
public virtual IAsyncResult BeginAdminConfirmSignUp(AdminConfirmSignUpRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminConfirmSignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminConfirmSignUpResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminConfirmSignUp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminConfirmSignUp.</param>
///
/// <returns>Returns a AdminConfirmSignUpResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp">REST API Reference for AdminConfirmSignUp Operation</seealso>
public virtual AdminConfirmSignUpResponse EndAdminConfirmSignUp(IAsyncResult asyncResult)
{
return EndInvoke<AdminConfirmSignUpResponse>(asyncResult);
}
#endregion
#region AdminCreateUser
/// <summary>
/// Creates a new user in the specified user pool.
///
///
/// <para>
/// If <code>MessageAction</code> is not set, the default is to send a welcome message
/// via email or phone (SMS).
/// </para>
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// <para>
/// This message is based on a template that you configured in your call to create or
/// update a user pool. This template includes your custom sign-up instructions and placeholders
/// for user name and temporary password.
/// </para>
///
/// <para>
/// Alternatively, you can call <code>AdminCreateUser</code> with “SUPPRESS” for the <code>MessageAction</code>
/// parameter, and Amazon Cognito will not send any email.
/// </para>
///
/// <para>
/// In either case, the user will be in the <code>FORCE_CHANGE_PASSWORD</code> state until
/// they sign in and change their password.
/// </para>
///
/// <para>
/// <code>AdminCreateUser</code> requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminCreateUser service method.</param>
///
/// <returns>The response from the AdminCreateUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PreconditionNotMetException">
/// This exception is thrown when a precondition is not met.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnsupportedUserStateException">
/// The request failed because the user is in an unsupported state.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UsernameExistsException">
/// This exception is thrown when Amazon Cognito encounters a user name that already exists
/// in the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser">REST API Reference for AdminCreateUser Operation</seealso>
public virtual AdminCreateUserResponse AdminCreateUser(AdminCreateUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminCreateUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminCreateUserResponseUnmarshaller.Instance;
return Invoke<AdminCreateUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminCreateUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminCreateUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminCreateUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser">REST API Reference for AdminCreateUser Operation</seealso>
public virtual IAsyncResult BeginAdminCreateUser(AdminCreateUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminCreateUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminCreateUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminCreateUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminCreateUser.</param>
///
/// <returns>Returns a AdminCreateUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser">REST API Reference for AdminCreateUser Operation</seealso>
public virtual AdminCreateUserResponse EndAdminCreateUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminCreateUserResponse>(asyncResult);
}
#endregion
#region AdminDeleteUser
/// <summary>
/// Deletes a user as an administrator. Works on any user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminDeleteUser service method.</param>
///
/// <returns>The response from the AdminDeleteUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser">REST API Reference for AdminDeleteUser Operation</seealso>
public virtual AdminDeleteUserResponse AdminDeleteUser(AdminDeleteUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDeleteUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDeleteUserResponseUnmarshaller.Instance;
return Invoke<AdminDeleteUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminDeleteUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminDeleteUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminDeleteUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser">REST API Reference for AdminDeleteUser Operation</seealso>
public virtual IAsyncResult BeginAdminDeleteUser(AdminDeleteUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDeleteUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDeleteUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminDeleteUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminDeleteUser.</param>
///
/// <returns>Returns a AdminDeleteUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser">REST API Reference for AdminDeleteUser Operation</seealso>
public virtual AdminDeleteUserResponse EndAdminDeleteUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminDeleteUserResponse>(asyncResult);
}
#endregion
#region AdminDeleteUserAttributes
/// <summary>
/// Deletes the user attributes in a user pool as an administrator. Works on any user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminDeleteUserAttributes service method.</param>
///
/// <returns>The response from the AdminDeleteUserAttributes service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes">REST API Reference for AdminDeleteUserAttributes Operation</seealso>
public virtual AdminDeleteUserAttributesResponse AdminDeleteUserAttributes(AdminDeleteUserAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDeleteUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDeleteUserAttributesResponseUnmarshaller.Instance;
return Invoke<AdminDeleteUserAttributesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminDeleteUserAttributes operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminDeleteUserAttributes operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminDeleteUserAttributes
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes">REST API Reference for AdminDeleteUserAttributes Operation</seealso>
public virtual IAsyncResult BeginAdminDeleteUserAttributes(AdminDeleteUserAttributesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDeleteUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDeleteUserAttributesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminDeleteUserAttributes operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminDeleteUserAttributes.</param>
///
/// <returns>Returns a AdminDeleteUserAttributesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes">REST API Reference for AdminDeleteUserAttributes Operation</seealso>
public virtual AdminDeleteUserAttributesResponse EndAdminDeleteUserAttributes(IAsyncResult asyncResult)
{
return EndInvoke<AdminDeleteUserAttributesResponse>(asyncResult);
}
#endregion
#region AdminDisableProviderForUser
/// <summary>
/// Disables the user from signing in with the specified external (SAML or social) identity
/// provider. If the user to disable is a Cognito User Pools native username + password
/// user, they are not permitted to use their password to sign-in. If the user to disable
/// is a linked external IdP user, any link between that user and an existing user is
/// removed. The next time the external user (no longer attached to the previously linked
/// <code>DestinationUser</code>) signs in, they must create a new user account. See <a
/// href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminLinkProviderForUser.html">AdminLinkProviderForUser</a>.
///
///
/// <para>
/// This action is enabled only for admin access and requires developer credentials.
/// </para>
///
/// <para>
/// The <code>ProviderName</code> must match the value specified when creating an IdP
/// for the pool.
/// </para>
///
/// <para>
/// To disable a native username + password user, the <code>ProviderName</code> value
/// must be <code>Cognito</code> and the <code>ProviderAttributeName</code> must be <code>Cognito_Subject</code>,
/// with the <code>ProviderAttributeValue</code> being the name that is used in the user
/// pool for the user.
/// </para>
///
/// <para>
/// The <code>ProviderAttributeName</code> must always be <code>Cognito_Subject</code>
/// for social identity providers. The <code>ProviderAttributeValue</code> must always
/// be the exact subject that was used when the user was originally linked as a source
/// user.
/// </para>
///
/// <para>
/// For de-linking a SAML identity, there are two scenarios. If the linked identity has
/// not yet been used to sign-in, the <code>ProviderAttributeName</code> and <code>ProviderAttributeValue</code>
/// must be the same values that were used for the <code>SourceUser</code> when the identities
/// were originally linked using <code> AdminLinkProviderForUser</code> call. (If the
/// linking was done with <code>ProviderAttributeName</code> set to <code>Cognito_Subject</code>,
/// the same applies here). However, if the user has already signed in, the <code>ProviderAttributeName</code>
/// must be <code>Cognito_Subject</code> and <code>ProviderAttributeValue</code> must
/// be the subject of the SAML assertion.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminDisableProviderForUser service method.</param>
///
/// <returns>The response from the AdminDisableProviderForUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser">REST API Reference for AdminDisableProviderForUser Operation</seealso>
public virtual AdminDisableProviderForUserResponse AdminDisableProviderForUser(AdminDisableProviderForUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDisableProviderForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDisableProviderForUserResponseUnmarshaller.Instance;
return Invoke<AdminDisableProviderForUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminDisableProviderForUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminDisableProviderForUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminDisableProviderForUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser">REST API Reference for AdminDisableProviderForUser Operation</seealso>
public virtual IAsyncResult BeginAdminDisableProviderForUser(AdminDisableProviderForUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDisableProviderForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDisableProviderForUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminDisableProviderForUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminDisableProviderForUser.</param>
///
/// <returns>Returns a AdminDisableProviderForUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser">REST API Reference for AdminDisableProviderForUser Operation</seealso>
public virtual AdminDisableProviderForUserResponse EndAdminDisableProviderForUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminDisableProviderForUserResponse>(asyncResult);
}
#endregion
#region AdminDisableUser
/// <summary>
/// Disables the specified user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminDisableUser service method.</param>
///
/// <returns>The response from the AdminDisableUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser">REST API Reference for AdminDisableUser Operation</seealso>
public virtual AdminDisableUserResponse AdminDisableUser(AdminDisableUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDisableUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDisableUserResponseUnmarshaller.Instance;
return Invoke<AdminDisableUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminDisableUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminDisableUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminDisableUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser">REST API Reference for AdminDisableUser Operation</seealso>
public virtual IAsyncResult BeginAdminDisableUser(AdminDisableUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminDisableUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminDisableUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminDisableUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminDisableUser.</param>
///
/// <returns>Returns a AdminDisableUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser">REST API Reference for AdminDisableUser Operation</seealso>
public virtual AdminDisableUserResponse EndAdminDisableUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminDisableUserResponse>(asyncResult);
}
#endregion
#region AdminEnableUser
/// <summary>
/// Enables the specified user as an administrator. Works on any user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminEnableUser service method.</param>
///
/// <returns>The response from the AdminEnableUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser">REST API Reference for AdminEnableUser Operation</seealso>
public virtual AdminEnableUserResponse AdminEnableUser(AdminEnableUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminEnableUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminEnableUserResponseUnmarshaller.Instance;
return Invoke<AdminEnableUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminEnableUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminEnableUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminEnableUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser">REST API Reference for AdminEnableUser Operation</seealso>
public virtual IAsyncResult BeginAdminEnableUser(AdminEnableUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminEnableUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminEnableUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminEnableUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminEnableUser.</param>
///
/// <returns>Returns a AdminEnableUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser">REST API Reference for AdminEnableUser Operation</seealso>
public virtual AdminEnableUserResponse EndAdminEnableUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminEnableUserResponse>(asyncResult);
}
#endregion
#region AdminForgetDevice
/// <summary>
/// Forgets the device, as an administrator.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminForgetDevice service method.</param>
///
/// <returns>The response from the AdminForgetDevice service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminForgetDevice">REST API Reference for AdminForgetDevice Operation</seealso>
public virtual AdminForgetDeviceResponse AdminForgetDevice(AdminForgetDeviceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminForgetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminForgetDeviceResponseUnmarshaller.Instance;
return Invoke<AdminForgetDeviceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminForgetDevice operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminForgetDevice operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminForgetDevice
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminForgetDevice">REST API Reference for AdminForgetDevice Operation</seealso>
public virtual IAsyncResult BeginAdminForgetDevice(AdminForgetDeviceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminForgetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminForgetDeviceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminForgetDevice operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminForgetDevice.</param>
///
/// <returns>Returns a AdminForgetDeviceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminForgetDevice">REST API Reference for AdminForgetDevice Operation</seealso>
public virtual AdminForgetDeviceResponse EndAdminForgetDevice(IAsyncResult asyncResult)
{
return EndInvoke<AdminForgetDeviceResponse>(asyncResult);
}
#endregion
#region AdminGetDevice
/// <summary>
/// Gets the device, as an administrator.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminGetDevice service method.</param>
///
/// <returns>The response from the AdminGetDevice service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetDevice">REST API Reference for AdminGetDevice Operation</seealso>
public virtual AdminGetDeviceResponse AdminGetDevice(AdminGetDeviceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminGetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminGetDeviceResponseUnmarshaller.Instance;
return Invoke<AdminGetDeviceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminGetDevice operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminGetDevice operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminGetDevice
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetDevice">REST API Reference for AdminGetDevice Operation</seealso>
public virtual IAsyncResult BeginAdminGetDevice(AdminGetDeviceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminGetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminGetDeviceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminGetDevice operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminGetDevice.</param>
///
/// <returns>Returns a AdminGetDeviceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetDevice">REST API Reference for AdminGetDevice Operation</seealso>
public virtual AdminGetDeviceResponse EndAdminGetDevice(IAsyncResult asyncResult)
{
return EndInvoke<AdminGetDeviceResponse>(asyncResult);
}
#endregion
#region AdminGetUser
/// <summary>
/// Gets the specified user by user name in a user pool as an administrator. Works on
/// any user.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminGetUser service method.</param>
///
/// <returns>The response from the AdminGetUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetUser">REST API Reference for AdminGetUser Operation</seealso>
public virtual AdminGetUserResponse AdminGetUser(AdminGetUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminGetUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminGetUserResponseUnmarshaller.Instance;
return Invoke<AdminGetUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminGetUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminGetUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminGetUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetUser">REST API Reference for AdminGetUser Operation</seealso>
public virtual IAsyncResult BeginAdminGetUser(AdminGetUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminGetUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminGetUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminGetUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminGetUser.</param>
///
/// <returns>Returns a AdminGetUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetUser">REST API Reference for AdminGetUser Operation</seealso>
public virtual AdminGetUserResponse EndAdminGetUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminGetUserResponse>(asyncResult);
}
#endregion
#region AdminInitiateAuth
/// <summary>
/// Initiates the authentication flow, as an administrator.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminInitiateAuth service method.</param>
///
/// <returns>The response from the AdminInitiateAuth service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.MFAMethodNotFoundException">
/// This exception is thrown when Amazon Cognito cannot find a multi-factor authentication
/// (MFA) method.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminInitiateAuth">REST API Reference for AdminInitiateAuth Operation</seealso>
public virtual AdminInitiateAuthResponse AdminInitiateAuth(AdminInitiateAuthRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminInitiateAuthRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminInitiateAuthResponseUnmarshaller.Instance;
return Invoke<AdminInitiateAuthResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminInitiateAuth operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminInitiateAuth operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminInitiateAuth
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminInitiateAuth">REST API Reference for AdminInitiateAuth Operation</seealso>
public virtual IAsyncResult BeginAdminInitiateAuth(AdminInitiateAuthRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminInitiateAuthRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminInitiateAuthResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminInitiateAuth operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminInitiateAuth.</param>
///
/// <returns>Returns a AdminInitiateAuthResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminInitiateAuth">REST API Reference for AdminInitiateAuth Operation</seealso>
public virtual AdminInitiateAuthResponse EndAdminInitiateAuth(IAsyncResult asyncResult)
{
return EndInvoke<AdminInitiateAuthResponse>(asyncResult);
}
#endregion
#region AdminLinkProviderForUser
/// <summary>
/// Links an existing user account in a user pool (<code>DestinationUser</code>) to an
/// identity from an external identity provider (<code>SourceUser</code>) based on a specified
/// attribute name and value from the external identity provider. This allows you to create
/// a link from the existing user account to an external federated user identity that
/// has not yet been used to sign in, so that the federated user identity can be used
/// to sign in as the existing user account.
///
///
/// <para>
/// For example, if there is an existing user with a username and password, this API
/// links that user to a federated user identity, so that when the federated user identity
/// is used, the user signs in as the existing user account.
/// </para>
/// <note>
/// <para>
/// The maximum number of federated identities linked to a user is 5.
/// </para>
/// </note> <important>
/// <para>
/// Because this API allows a user with an external federated identity to sign in as an
/// existing user in the user pool, it is critical that it only be used with external
/// identity providers and provider attributes that have been trusted by the application
/// owner.
/// </para>
/// </important>
/// <para>
/// This action is enabled only for admin access and requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminLinkProviderForUser service method.</param>
///
/// <returns>The response from the AdminLinkProviderForUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminLinkProviderForUser">REST API Reference for AdminLinkProviderForUser Operation</seealso>
public virtual AdminLinkProviderForUserResponse AdminLinkProviderForUser(AdminLinkProviderForUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminLinkProviderForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminLinkProviderForUserResponseUnmarshaller.Instance;
return Invoke<AdminLinkProviderForUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminLinkProviderForUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminLinkProviderForUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminLinkProviderForUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminLinkProviderForUser">REST API Reference for AdminLinkProviderForUser Operation</seealso>
public virtual IAsyncResult BeginAdminLinkProviderForUser(AdminLinkProviderForUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminLinkProviderForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminLinkProviderForUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminLinkProviderForUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminLinkProviderForUser.</param>
///
/// <returns>Returns a AdminLinkProviderForUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminLinkProviderForUser">REST API Reference for AdminLinkProviderForUser Operation</seealso>
public virtual AdminLinkProviderForUserResponse EndAdminLinkProviderForUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminLinkProviderForUserResponse>(asyncResult);
}
#endregion
#region AdminListDevices
/// <summary>
/// Lists devices, as an administrator.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminListDevices service method.</param>
///
/// <returns>The response from the AdminListDevices service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListDevices">REST API Reference for AdminListDevices Operation</seealso>
public virtual AdminListDevicesResponse AdminListDevices(AdminListDevicesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListDevicesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListDevicesResponseUnmarshaller.Instance;
return Invoke<AdminListDevicesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminListDevices operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminListDevices operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminListDevices
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListDevices">REST API Reference for AdminListDevices Operation</seealso>
public virtual IAsyncResult BeginAdminListDevices(AdminListDevicesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListDevicesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListDevicesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminListDevices operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminListDevices.</param>
///
/// <returns>Returns a AdminListDevicesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListDevices">REST API Reference for AdminListDevices Operation</seealso>
public virtual AdminListDevicesResponse EndAdminListDevices(IAsyncResult asyncResult)
{
return EndInvoke<AdminListDevicesResponse>(asyncResult);
}
#endregion
#region AdminListGroupsForUser
/// <summary>
/// Lists the groups that the user belongs to.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminListGroupsForUser service method.</param>
///
/// <returns>The response from the AdminListGroupsForUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListGroupsForUser">REST API Reference for AdminListGroupsForUser Operation</seealso>
public virtual AdminListGroupsForUserResponse AdminListGroupsForUser(AdminListGroupsForUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListGroupsForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListGroupsForUserResponseUnmarshaller.Instance;
return Invoke<AdminListGroupsForUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminListGroupsForUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminListGroupsForUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminListGroupsForUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListGroupsForUser">REST API Reference for AdminListGroupsForUser Operation</seealso>
public virtual IAsyncResult BeginAdminListGroupsForUser(AdminListGroupsForUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListGroupsForUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListGroupsForUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminListGroupsForUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminListGroupsForUser.</param>
///
/// <returns>Returns a AdminListGroupsForUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListGroupsForUser">REST API Reference for AdminListGroupsForUser Operation</seealso>
public virtual AdminListGroupsForUserResponse EndAdminListGroupsForUser(IAsyncResult asyncResult)
{
return EndInvoke<AdminListGroupsForUserResponse>(asyncResult);
}
#endregion
#region AdminListUserAuthEvents
/// <summary>
/// Lists a history of user activity and any risks detected as part of Amazon Cognito
/// advanced security.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminListUserAuthEvents service method.</param>
///
/// <returns>The response from the AdminListUserAuthEvents service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolAddOnNotEnabledException">
/// This exception is thrown when user pool add-ons are not enabled.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListUserAuthEvents">REST API Reference for AdminListUserAuthEvents Operation</seealso>
public virtual AdminListUserAuthEventsResponse AdminListUserAuthEvents(AdminListUserAuthEventsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListUserAuthEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListUserAuthEventsResponseUnmarshaller.Instance;
return Invoke<AdminListUserAuthEventsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminListUserAuthEvents operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminListUserAuthEvents operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminListUserAuthEvents
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListUserAuthEvents">REST API Reference for AdminListUserAuthEvents Operation</seealso>
public virtual IAsyncResult BeginAdminListUserAuthEvents(AdminListUserAuthEventsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminListUserAuthEventsRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminListUserAuthEventsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminListUserAuthEvents operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminListUserAuthEvents.</param>
///
/// <returns>Returns a AdminListUserAuthEventsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListUserAuthEvents">REST API Reference for AdminListUserAuthEvents Operation</seealso>
public virtual AdminListUserAuthEventsResponse EndAdminListUserAuthEvents(IAsyncResult asyncResult)
{
return EndInvoke<AdminListUserAuthEventsResponse>(asyncResult);
}
#endregion
#region AdminRemoveUserFromGroup
/// <summary>
/// Removes the specified user from the specified group.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminRemoveUserFromGroup service method.</param>
///
/// <returns>The response from the AdminRemoveUserFromGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRemoveUserFromGroup">REST API Reference for AdminRemoveUserFromGroup Operation</seealso>
public virtual AdminRemoveUserFromGroupResponse AdminRemoveUserFromGroup(AdminRemoveUserFromGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminRemoveUserFromGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminRemoveUserFromGroupResponseUnmarshaller.Instance;
return Invoke<AdminRemoveUserFromGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminRemoveUserFromGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminRemoveUserFromGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminRemoveUserFromGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRemoveUserFromGroup">REST API Reference for AdminRemoveUserFromGroup Operation</seealso>
public virtual IAsyncResult BeginAdminRemoveUserFromGroup(AdminRemoveUserFromGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminRemoveUserFromGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminRemoveUserFromGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminRemoveUserFromGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminRemoveUserFromGroup.</param>
///
/// <returns>Returns a AdminRemoveUserFromGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRemoveUserFromGroup">REST API Reference for AdminRemoveUserFromGroup Operation</seealso>
public virtual AdminRemoveUserFromGroupResponse EndAdminRemoveUserFromGroup(IAsyncResult asyncResult)
{
return EndInvoke<AdminRemoveUserFromGroupResponse>(asyncResult);
}
#endregion
#region AdminResetUserPassword
/// <summary>
/// Resets the specified user's password in a user pool as an administrator. Works on
/// any user.
///
///
/// <para>
/// When a developer calls this API, the current password is invalidated, so it must be
/// changed. If a user tries to sign in after the API is called, the app will get a PasswordResetRequiredException
/// exception back and should direct the user down the flow to reset the password, which
/// is the same as the forgot password flow. In addition, if the user pool has phone verification
/// selected and a verified phone number exists for the user, or if email verification
/// is selected and a verified email exists for the user, calling this API will also result
/// in sending a message to the end user with the code to change their password.
/// </para>
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminResetUserPassword service method.</param>
///
/// <returns>The response from the AdminResetUserPassword service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminResetUserPassword">REST API Reference for AdminResetUserPassword Operation</seealso>
public virtual AdminResetUserPasswordResponse AdminResetUserPassword(AdminResetUserPasswordRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminResetUserPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminResetUserPasswordResponseUnmarshaller.Instance;
return Invoke<AdminResetUserPasswordResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminResetUserPassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminResetUserPassword operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminResetUserPassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminResetUserPassword">REST API Reference for AdminResetUserPassword Operation</seealso>
public virtual IAsyncResult BeginAdminResetUserPassword(AdminResetUserPasswordRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminResetUserPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminResetUserPasswordResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminResetUserPassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminResetUserPassword.</param>
///
/// <returns>Returns a AdminResetUserPasswordResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminResetUserPassword">REST API Reference for AdminResetUserPassword Operation</seealso>
public virtual AdminResetUserPasswordResponse EndAdminResetUserPassword(IAsyncResult asyncResult)
{
return EndInvoke<AdminResetUserPasswordResponse>(asyncResult);
}
#endregion
#region AdminRespondToAuthChallenge
/// <summary>
/// Responds to an authentication challenge, as an administrator.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminRespondToAuthChallenge service method.</param>
///
/// <returns>The response from the AdminRespondToAuthChallenge service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.MFAMethodNotFoundException">
/// This exception is thrown when Amazon Cognito cannot find a multi-factor authentication
/// (MFA) method.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.SoftwareTokenMFANotFoundException">
/// This exception is thrown when the software token TOTP multi-factor authentication
/// (MFA) is not enabled for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRespondToAuthChallenge">REST API Reference for AdminRespondToAuthChallenge Operation</seealso>
public virtual AdminRespondToAuthChallengeResponse AdminRespondToAuthChallenge(AdminRespondToAuthChallengeRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminRespondToAuthChallengeRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminRespondToAuthChallengeResponseUnmarshaller.Instance;
return Invoke<AdminRespondToAuthChallengeResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminRespondToAuthChallenge operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminRespondToAuthChallenge operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminRespondToAuthChallenge
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRespondToAuthChallenge">REST API Reference for AdminRespondToAuthChallenge Operation</seealso>
public virtual IAsyncResult BeginAdminRespondToAuthChallenge(AdminRespondToAuthChallengeRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminRespondToAuthChallengeRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminRespondToAuthChallengeResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminRespondToAuthChallenge operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminRespondToAuthChallenge.</param>
///
/// <returns>Returns a AdminRespondToAuthChallengeResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRespondToAuthChallenge">REST API Reference for AdminRespondToAuthChallenge Operation</seealso>
public virtual AdminRespondToAuthChallengeResponse EndAdminRespondToAuthChallenge(IAsyncResult asyncResult)
{
return EndInvoke<AdminRespondToAuthChallengeResponse>(asyncResult);
}
#endregion
#region AdminSetUserMFAPreference
/// <summary>
/// Sets the user's multi-factor authentication (MFA) preference, including which MFA
/// options are enabled and if any are preferred. Only one factor can be set as preferred.
/// The preferred MFA factor will be used to authenticate a user if multiple factors are
/// enabled. If multiple options are enabled and no preference is set, a challenge to
/// choose an MFA option will be returned during sign in.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserMFAPreference service method.</param>
///
/// <returns>The response from the AdminSetUserMFAPreference service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserMFAPreference">REST API Reference for AdminSetUserMFAPreference Operation</seealso>
public virtual AdminSetUserMFAPreferenceResponse AdminSetUserMFAPreference(AdminSetUserMFAPreferenceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserMFAPreferenceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserMFAPreferenceResponseUnmarshaller.Instance;
return Invoke<AdminSetUserMFAPreferenceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminSetUserMFAPreference operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserMFAPreference operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminSetUserMFAPreference
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserMFAPreference">REST API Reference for AdminSetUserMFAPreference Operation</seealso>
public virtual IAsyncResult BeginAdminSetUserMFAPreference(AdminSetUserMFAPreferenceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserMFAPreferenceRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserMFAPreferenceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminSetUserMFAPreference operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminSetUserMFAPreference.</param>
///
/// <returns>Returns a AdminSetUserMFAPreferenceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserMFAPreference">REST API Reference for AdminSetUserMFAPreference Operation</seealso>
public virtual AdminSetUserMFAPreferenceResponse EndAdminSetUserMFAPreference(IAsyncResult asyncResult)
{
return EndInvoke<AdminSetUserMFAPreferenceResponse>(asyncResult);
}
#endregion
#region AdminSetUserPassword
/// <summary>
/// Sets the specified user's password in a user pool as an administrator. Works on any
/// user.
///
///
/// <para>
/// The password can be temporary or permanent. If it is temporary, the user status will
/// be placed into the <code>FORCE_CHANGE_PASSWORD</code> state. When the user next tries
/// to sign in, the InitiateAuth/AdminInitiateAuth response will contain the <code>NEW_PASSWORD_REQUIRED</code>
/// challenge. If the user does not sign in before it expires, the user will not be able
/// to sign in and their password will need to be reset by an administrator.
/// </para>
///
/// <para>
/// Once the user has set a new password, or the password is permanent, the user status
/// will be set to <code>Confirmed</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserPassword service method.</param>
///
/// <returns>The response from the AdminSetUserPassword service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserPassword">REST API Reference for AdminSetUserPassword Operation</seealso>
public virtual AdminSetUserPasswordResponse AdminSetUserPassword(AdminSetUserPasswordRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserPasswordResponseUnmarshaller.Instance;
return Invoke<AdminSetUserPasswordResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminSetUserPassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserPassword operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminSetUserPassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserPassword">REST API Reference for AdminSetUserPassword Operation</seealso>
public virtual IAsyncResult BeginAdminSetUserPassword(AdminSetUserPasswordRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserPasswordResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminSetUserPassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminSetUserPassword.</param>
///
/// <returns>Returns a AdminSetUserPasswordResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserPassword">REST API Reference for AdminSetUserPassword Operation</seealso>
public virtual AdminSetUserPasswordResponse EndAdminSetUserPassword(IAsyncResult asyncResult)
{
return EndInvoke<AdminSetUserPasswordResponse>(asyncResult);
}
#endregion
#region AdminSetUserSettings
/// <summary>
/// <i>This action is no longer supported.</i> You can use it to configure only SMS MFA.
/// You can't use it to configure TOTP software token MFA. To configure either type of
/// MFA, use <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminSetUserMFAPreference.html">AdminSetUserMFAPreference</a>
/// instead.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserSettings service method.</param>
///
/// <returns>The response from the AdminSetUserSettings service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserSettings">REST API Reference for AdminSetUserSettings Operation</seealso>
public virtual AdminSetUserSettingsResponse AdminSetUserSettings(AdminSetUserSettingsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserSettingsResponseUnmarshaller.Instance;
return Invoke<AdminSetUserSettingsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminSetUserSettings operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminSetUserSettings operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminSetUserSettings
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserSettings">REST API Reference for AdminSetUserSettings Operation</seealso>
public virtual IAsyncResult BeginAdminSetUserSettings(AdminSetUserSettingsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminSetUserSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminSetUserSettingsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminSetUserSettings operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminSetUserSettings.</param>
///
/// <returns>Returns a AdminSetUserSettingsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserSettings">REST API Reference for AdminSetUserSettings Operation</seealso>
public virtual AdminSetUserSettingsResponse EndAdminSetUserSettings(IAsyncResult asyncResult)
{
return EndInvoke<AdminSetUserSettingsResponse>(asyncResult);
}
#endregion
#region AdminUpdateAuthEventFeedback
/// <summary>
/// Provides feedback for an authentication event as to whether it was from a valid user.
/// This feedback is used for improving the risk evaluation decision for the user pool
/// as part of Amazon Cognito advanced security.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateAuthEventFeedback service method.</param>
///
/// <returns>The response from the AdminUpdateAuthEventFeedback service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolAddOnNotEnabledException">
/// This exception is thrown when user pool add-ons are not enabled.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateAuthEventFeedback">REST API Reference for AdminUpdateAuthEventFeedback Operation</seealso>
public virtual AdminUpdateAuthEventFeedbackResponse AdminUpdateAuthEventFeedback(AdminUpdateAuthEventFeedbackRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateAuthEventFeedbackRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateAuthEventFeedbackResponseUnmarshaller.Instance;
return Invoke<AdminUpdateAuthEventFeedbackResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminUpdateAuthEventFeedback operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateAuthEventFeedback operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminUpdateAuthEventFeedback
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateAuthEventFeedback">REST API Reference for AdminUpdateAuthEventFeedback Operation</seealso>
public virtual IAsyncResult BeginAdminUpdateAuthEventFeedback(AdminUpdateAuthEventFeedbackRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateAuthEventFeedbackRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateAuthEventFeedbackResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminUpdateAuthEventFeedback operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminUpdateAuthEventFeedback.</param>
///
/// <returns>Returns a AdminUpdateAuthEventFeedbackResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateAuthEventFeedback">REST API Reference for AdminUpdateAuthEventFeedback Operation</seealso>
public virtual AdminUpdateAuthEventFeedbackResponse EndAdminUpdateAuthEventFeedback(IAsyncResult asyncResult)
{
return EndInvoke<AdminUpdateAuthEventFeedbackResponse>(asyncResult);
}
#endregion
#region AdminUpdateDeviceStatus
/// <summary>
/// Updates the device status as an administrator.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateDeviceStatus service method.</param>
///
/// <returns>The response from the AdminUpdateDeviceStatus service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateDeviceStatus">REST API Reference for AdminUpdateDeviceStatus Operation</seealso>
public virtual AdminUpdateDeviceStatusResponse AdminUpdateDeviceStatus(AdminUpdateDeviceStatusRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateDeviceStatusRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateDeviceStatusResponseUnmarshaller.Instance;
return Invoke<AdminUpdateDeviceStatusResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminUpdateDeviceStatus operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateDeviceStatus operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminUpdateDeviceStatus
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateDeviceStatus">REST API Reference for AdminUpdateDeviceStatus Operation</seealso>
public virtual IAsyncResult BeginAdminUpdateDeviceStatus(AdminUpdateDeviceStatusRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateDeviceStatusRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateDeviceStatusResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminUpdateDeviceStatus operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminUpdateDeviceStatus.</param>
///
/// <returns>Returns a AdminUpdateDeviceStatusResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateDeviceStatus">REST API Reference for AdminUpdateDeviceStatus Operation</seealso>
public virtual AdminUpdateDeviceStatusResponse EndAdminUpdateDeviceStatus(IAsyncResult asyncResult)
{
return EndInvoke<AdminUpdateDeviceStatusResponse>(asyncResult);
}
#endregion
#region AdminUpdateUserAttributes
/// <summary>
/// Updates the specified user's attributes, including developer attributes, as an administrator.
/// Works on any user.
///
///
/// <para>
/// For custom attributes, you must prepend the <code>custom:</code> prefix to the attribute
/// name.
/// </para>
///
/// <para>
/// In addition to updating user attributes, this API can also be used to mark phone and
/// email as verified.
/// </para>
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateUserAttributes service method.</param>
///
/// <returns>The response from the AdminUpdateUserAttributes service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateUserAttributes">REST API Reference for AdminUpdateUserAttributes Operation</seealso>
public virtual AdminUpdateUserAttributesResponse AdminUpdateUserAttributes(AdminUpdateUserAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateUserAttributesResponseUnmarshaller.Instance;
return Invoke<AdminUpdateUserAttributesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminUpdateUserAttributes operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminUpdateUserAttributes operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminUpdateUserAttributes
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateUserAttributes">REST API Reference for AdminUpdateUserAttributes Operation</seealso>
public virtual IAsyncResult BeginAdminUpdateUserAttributes(AdminUpdateUserAttributesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUpdateUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUpdateUserAttributesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminUpdateUserAttributes operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminUpdateUserAttributes.</param>
///
/// <returns>Returns a AdminUpdateUserAttributesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateUserAttributes">REST API Reference for AdminUpdateUserAttributes Operation</seealso>
public virtual AdminUpdateUserAttributesResponse EndAdminUpdateUserAttributes(IAsyncResult asyncResult)
{
return EndInvoke<AdminUpdateUserAttributesResponse>(asyncResult);
}
#endregion
#region AdminUserGlobalSignOut
/// <summary>
/// Signs out users from all devices, as an administrator. It also invalidates all refresh
/// tokens issued to a user. The user's current access and Id tokens remain valid until
/// their expiry. Access and Id tokens expire one hour after they are issued.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AdminUserGlobalSignOut service method.</param>
///
/// <returns>The response from the AdminUserGlobalSignOut service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUserGlobalSignOut">REST API Reference for AdminUserGlobalSignOut Operation</seealso>
public virtual AdminUserGlobalSignOutResponse AdminUserGlobalSignOut(AdminUserGlobalSignOutRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUserGlobalSignOutRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUserGlobalSignOutResponseUnmarshaller.Instance;
return Invoke<AdminUserGlobalSignOutResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AdminUserGlobalSignOut operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AdminUserGlobalSignOut operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAdminUserGlobalSignOut
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUserGlobalSignOut">REST API Reference for AdminUserGlobalSignOut Operation</seealso>
public virtual IAsyncResult BeginAdminUserGlobalSignOut(AdminUserGlobalSignOutRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AdminUserGlobalSignOutRequestMarshaller.Instance;
options.ResponseUnmarshaller = AdminUserGlobalSignOutResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AdminUserGlobalSignOut operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAdminUserGlobalSignOut.</param>
///
/// <returns>Returns a AdminUserGlobalSignOutResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUserGlobalSignOut">REST API Reference for AdminUserGlobalSignOut Operation</seealso>
public virtual AdminUserGlobalSignOutResponse EndAdminUserGlobalSignOut(IAsyncResult asyncResult)
{
return EndInvoke<AdminUserGlobalSignOutResponse>(asyncResult);
}
#endregion
#region AssociateSoftwareToken
/// <summary>
/// Returns a unique generated shared secret key code for the user account. The request
/// takes an access token or a session string, but not both.
///
/// <note>
/// <para>
/// Calling AssociateSoftwareToken immediately disassociates the existing software token
/// from the user account. If the user doesn't subsequently verify the software token,
/// their account is essentially set up to authenticate without MFA. If MFA config is
/// set to Optional at the user pool level, the user can then login without MFA. However,
/// if MFA is set to Required for the user pool, the user will be asked to setup a new
/// software token MFA during sign in.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the AssociateSoftwareToken service method.</param>
///
/// <returns>The response from the AssociateSoftwareToken service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ConcurrentModificationException">
/// This exception is thrown if two or more modifications are happening concurrently.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.SoftwareTokenMFANotFoundException">
/// This exception is thrown when the software token TOTP multi-factor authentication
/// (MFA) is not enabled for the user pool.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AssociateSoftwareToken">REST API Reference for AssociateSoftwareToken Operation</seealso>
public virtual AssociateSoftwareTokenResponse AssociateSoftwareToken(AssociateSoftwareTokenRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AssociateSoftwareTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = AssociateSoftwareTokenResponseUnmarshaller.Instance;
return Invoke<AssociateSoftwareTokenResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the AssociateSoftwareToken operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the AssociateSoftwareToken operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndAssociateSoftwareToken
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AssociateSoftwareToken">REST API Reference for AssociateSoftwareToken Operation</seealso>
public virtual IAsyncResult BeginAssociateSoftwareToken(AssociateSoftwareTokenRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = AssociateSoftwareTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = AssociateSoftwareTokenResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the AssociateSoftwareToken operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginAssociateSoftwareToken.</param>
///
/// <returns>Returns a AssociateSoftwareTokenResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AssociateSoftwareToken">REST API Reference for AssociateSoftwareToken Operation</seealso>
public virtual AssociateSoftwareTokenResponse EndAssociateSoftwareToken(IAsyncResult asyncResult)
{
return EndInvoke<AssociateSoftwareTokenResponse>(asyncResult);
}
#endregion
#region ChangePassword
/// <summary>
/// Changes the password for a specified user in a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ChangePassword service method.</param>
///
/// <returns>The response from the ChangePassword service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ChangePassword">REST API Reference for ChangePassword Operation</seealso>
public virtual ChangePasswordResponse ChangePassword(ChangePasswordRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangePasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangePasswordResponseUnmarshaller.Instance;
return Invoke<ChangePasswordResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ChangePassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ChangePassword operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndChangePassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ChangePassword">REST API Reference for ChangePassword Operation</seealso>
public virtual IAsyncResult BeginChangePassword(ChangePasswordRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangePasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangePasswordResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ChangePassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginChangePassword.</param>
///
/// <returns>Returns a ChangePasswordResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ChangePassword">REST API Reference for ChangePassword Operation</seealso>
public virtual ChangePasswordResponse EndChangePassword(IAsyncResult asyncResult)
{
return EndInvoke<ChangePasswordResponse>(asyncResult);
}
#endregion
#region ConfirmDevice
/// <summary>
/// Confirms tracking of the device. This API call is the call that begins device tracking.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ConfirmDevice service method.</param>
///
/// <returns>The response from the ConfirmDevice service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UsernameExistsException">
/// This exception is thrown when Amazon Cognito encounters a user name that already exists
/// in the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmDevice">REST API Reference for ConfirmDevice Operation</seealso>
public virtual ConfirmDeviceResponse ConfirmDevice(ConfirmDeviceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmDeviceResponseUnmarshaller.Instance;
return Invoke<ConfirmDeviceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ConfirmDevice operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ConfirmDevice operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndConfirmDevice
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmDevice">REST API Reference for ConfirmDevice Operation</seealso>
public virtual IAsyncResult BeginConfirmDevice(ConfirmDeviceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmDeviceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ConfirmDevice operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginConfirmDevice.</param>
///
/// <returns>Returns a ConfirmDeviceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmDevice">REST API Reference for ConfirmDevice Operation</seealso>
public virtual ConfirmDeviceResponse EndConfirmDevice(IAsyncResult asyncResult)
{
return EndInvoke<ConfirmDeviceResponse>(asyncResult);
}
#endregion
#region ConfirmForgotPassword
/// <summary>
/// Allows a user to enter a confirmation code to reset a forgotten password.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ConfirmForgotPassword service method.</param>
///
/// <returns>The response from the ConfirmForgotPassword service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyFailedAttemptsException">
/// This exception is thrown when the user has made too many failed attempts for a given
/// action (e.g., sign in).
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmForgotPassword">REST API Reference for ConfirmForgotPassword Operation</seealso>
public virtual ConfirmForgotPasswordResponse ConfirmForgotPassword(ConfirmForgotPasswordRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmForgotPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmForgotPasswordResponseUnmarshaller.Instance;
return Invoke<ConfirmForgotPasswordResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ConfirmForgotPassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ConfirmForgotPassword operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndConfirmForgotPassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmForgotPassword">REST API Reference for ConfirmForgotPassword Operation</seealso>
public virtual IAsyncResult BeginConfirmForgotPassword(ConfirmForgotPasswordRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmForgotPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmForgotPasswordResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ConfirmForgotPassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginConfirmForgotPassword.</param>
///
/// <returns>Returns a ConfirmForgotPasswordResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmForgotPassword">REST API Reference for ConfirmForgotPassword Operation</seealso>
public virtual ConfirmForgotPasswordResponse EndConfirmForgotPassword(IAsyncResult asyncResult)
{
return EndInvoke<ConfirmForgotPasswordResponse>(asyncResult);
}
#endregion
#region ConfirmSignUp
/// <summary>
/// Confirms registration of a user and handles the existing alias from a previous user.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ConfirmSignUp service method.</param>
///
/// <returns>The response from the ConfirmSignUp service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyFailedAttemptsException">
/// This exception is thrown when the user has made too many failed attempts for a given
/// action (e.g., sign in).
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmSignUp">REST API Reference for ConfirmSignUp Operation</seealso>
public virtual ConfirmSignUpResponse ConfirmSignUp(ConfirmSignUpRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmSignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmSignUpResponseUnmarshaller.Instance;
return Invoke<ConfirmSignUpResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ConfirmSignUp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ConfirmSignUp operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndConfirmSignUp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmSignUp">REST API Reference for ConfirmSignUp Operation</seealso>
public virtual IAsyncResult BeginConfirmSignUp(ConfirmSignUpRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ConfirmSignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = ConfirmSignUpResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ConfirmSignUp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginConfirmSignUp.</param>
///
/// <returns>Returns a ConfirmSignUpResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmSignUp">REST API Reference for ConfirmSignUp Operation</seealso>
public virtual ConfirmSignUpResponse EndConfirmSignUp(IAsyncResult asyncResult)
{
return EndInvoke<ConfirmSignUpResponse>(asyncResult);
}
#endregion
#region CreateGroup
/// <summary>
/// Creates a new group in the specified user pool.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateGroup service method.</param>
///
/// <returns>The response from the CreateGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.GroupExistsException">
/// This exception is thrown when Amazon Cognito encounters a group that already exists
/// in the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateGroup">REST API Reference for CreateGroup Operation</seealso>
public virtual CreateGroupResponse CreateGroup(CreateGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateGroupResponseUnmarshaller.Instance;
return Invoke<CreateGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateGroup">REST API Reference for CreateGroup Operation</seealso>
public virtual IAsyncResult BeginCreateGroup(CreateGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateGroup.</param>
///
/// <returns>Returns a CreateGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateGroup">REST API Reference for CreateGroup Operation</seealso>
public virtual CreateGroupResponse EndCreateGroup(IAsyncResult asyncResult)
{
return EndInvoke<CreateGroupResponse>(asyncResult);
}
#endregion
#region CreateIdentityProvider
/// <summary>
/// Creates an identity provider for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateIdentityProvider service method.</param>
///
/// <returns>The response from the CreateIdentityProvider service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.DuplicateProviderException">
/// This exception is thrown when the provider is already supported by the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateIdentityProvider">REST API Reference for CreateIdentityProvider Operation</seealso>
public virtual CreateIdentityProviderResponse CreateIdentityProvider(CreateIdentityProviderRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateIdentityProviderResponseUnmarshaller.Instance;
return Invoke<CreateIdentityProviderResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateIdentityProvider operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateIdentityProvider operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateIdentityProvider
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateIdentityProvider">REST API Reference for CreateIdentityProvider Operation</seealso>
public virtual IAsyncResult BeginCreateIdentityProvider(CreateIdentityProviderRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateIdentityProviderResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateIdentityProvider operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateIdentityProvider.</param>
///
/// <returns>Returns a CreateIdentityProviderResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateIdentityProvider">REST API Reference for CreateIdentityProvider Operation</seealso>
public virtual CreateIdentityProviderResponse EndCreateIdentityProvider(IAsyncResult asyncResult)
{
return EndInvoke<CreateIdentityProviderResponse>(asyncResult);
}
#endregion
#region CreateResourceServer
/// <summary>
/// Creates a new OAuth2.0 resource server and defines custom scopes in it.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateResourceServer service method.</param>
///
/// <returns>The response from the CreateResourceServer service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateResourceServer">REST API Reference for CreateResourceServer Operation</seealso>
public virtual CreateResourceServerResponse CreateResourceServer(CreateResourceServerRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateResourceServerResponseUnmarshaller.Instance;
return Invoke<CreateResourceServerResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateResourceServer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateResourceServer operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateResourceServer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateResourceServer">REST API Reference for CreateResourceServer Operation</seealso>
public virtual IAsyncResult BeginCreateResourceServer(CreateResourceServerRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateResourceServerResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateResourceServer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateResourceServer.</param>
///
/// <returns>Returns a CreateResourceServerResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateResourceServer">REST API Reference for CreateResourceServer Operation</seealso>
public virtual CreateResourceServerResponse EndCreateResourceServer(IAsyncResult asyncResult)
{
return EndInvoke<CreateResourceServerResponse>(asyncResult);
}
#endregion
#region CreateUserImportJob
/// <summary>
/// Creates the user import job.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateUserImportJob service method.</param>
///
/// <returns>The response from the CreateUserImportJob service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PreconditionNotMetException">
/// This exception is thrown when a precondition is not met.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserImportJob">REST API Reference for CreateUserImportJob Operation</seealso>
public virtual CreateUserImportJobResponse CreateUserImportJob(CreateUserImportJobRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserImportJobResponseUnmarshaller.Instance;
return Invoke<CreateUserImportJobResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateUserImportJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateUserImportJob operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateUserImportJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserImportJob">REST API Reference for CreateUserImportJob Operation</seealso>
public virtual IAsyncResult BeginCreateUserImportJob(CreateUserImportJobRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserImportJobResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateUserImportJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateUserImportJob.</param>
///
/// <returns>Returns a CreateUserImportJobResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserImportJob">REST API Reference for CreateUserImportJob Operation</seealso>
public virtual CreateUserImportJobResponse EndCreateUserImportJob(IAsyncResult asyncResult)
{
return EndInvoke<CreateUserImportJobResponse>(asyncResult);
}
#endregion
#region CreateUserPool
/// <summary>
/// Creates a new Amazon Cognito user pool and sets the password policy for the pool.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateUserPool service method.</param>
///
/// <returns>The response from the CreateUserPool service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolTaggingException">
/// This exception is thrown when a user pool tag cannot be set or updated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPool">REST API Reference for CreateUserPool Operation</seealso>
public virtual CreateUserPoolResponse CreateUserPool(CreateUserPoolRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolResponseUnmarshaller.Instance;
return Invoke<CreateUserPoolResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateUserPool operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateUserPool operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateUserPool
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPool">REST API Reference for CreateUserPool Operation</seealso>
public virtual IAsyncResult BeginCreateUserPool(CreateUserPoolRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateUserPool operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateUserPool.</param>
///
/// <returns>Returns a CreateUserPoolResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPool">REST API Reference for CreateUserPool Operation</seealso>
public virtual CreateUserPoolResponse EndCreateUserPool(IAsyncResult asyncResult)
{
return EndInvoke<CreateUserPoolResponse>(asyncResult);
}
#endregion
#region CreateUserPoolClient
/// <summary>
/// Creates the user pool client.
///
///
/// <para>
/// When you create a new user pool client, token revocation is automatically enabled.
/// For more information about revoking tokens, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html">RevokeToken</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateUserPoolClient service method.</param>
///
/// <returns>The response from the CreateUserPoolClient service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidOAuthFlowException">
/// This exception is thrown when the specified OAuth flow is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ScopeDoesNotExistException">
/// This exception is thrown when the specified scope does not exist.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolClient">REST API Reference for CreateUserPoolClient Operation</seealso>
public virtual CreateUserPoolClientResponse CreateUserPoolClient(CreateUserPoolClientRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolClientResponseUnmarshaller.Instance;
return Invoke<CreateUserPoolClientResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateUserPoolClient operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateUserPoolClient operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateUserPoolClient
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolClient">REST API Reference for CreateUserPoolClient Operation</seealso>
public virtual IAsyncResult BeginCreateUserPoolClient(CreateUserPoolClientRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolClientResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateUserPoolClient operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateUserPoolClient.</param>
///
/// <returns>Returns a CreateUserPoolClientResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolClient">REST API Reference for CreateUserPoolClient Operation</seealso>
public virtual CreateUserPoolClientResponse EndCreateUserPoolClient(IAsyncResult asyncResult)
{
return EndInvoke<CreateUserPoolClientResponse>(asyncResult);
}
#endregion
#region CreateUserPoolDomain
/// <summary>
/// Creates a new domain for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the CreateUserPoolDomain service method.</param>
///
/// <returns>The response from the CreateUserPoolDomain service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolDomain">REST API Reference for CreateUserPoolDomain Operation</seealso>
public virtual CreateUserPoolDomainResponse CreateUserPoolDomain(CreateUserPoolDomainRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolDomainResponseUnmarshaller.Instance;
return Invoke<CreateUserPoolDomainResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the CreateUserPoolDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the CreateUserPoolDomain operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateUserPoolDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolDomain">REST API Reference for CreateUserPoolDomain Operation</seealso>
public virtual IAsyncResult BeginCreateUserPoolDomain(CreateUserPoolDomainRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateUserPoolDomainResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the CreateUserPoolDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginCreateUserPoolDomain.</param>
///
/// <returns>Returns a CreateUserPoolDomainResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolDomain">REST API Reference for CreateUserPoolDomain Operation</seealso>
public virtual CreateUserPoolDomainResponse EndCreateUserPoolDomain(IAsyncResult asyncResult)
{
return EndInvoke<CreateUserPoolDomainResponse>(asyncResult);
}
#endregion
#region DeleteGroup
/// <summary>
/// Deletes a group.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteGroup service method.</param>
///
/// <returns>The response from the DeleteGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteGroup">REST API Reference for DeleteGroup Operation</seealso>
public virtual DeleteGroupResponse DeleteGroup(DeleteGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteGroupResponseUnmarshaller.Instance;
return Invoke<DeleteGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteGroup">REST API Reference for DeleteGroup Operation</seealso>
public virtual IAsyncResult BeginDeleteGroup(DeleteGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteGroup.</param>
///
/// <returns>Returns a DeleteGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteGroup">REST API Reference for DeleteGroup Operation</seealso>
public virtual DeleteGroupResponse EndDeleteGroup(IAsyncResult asyncResult)
{
return EndInvoke<DeleteGroupResponse>(asyncResult);
}
#endregion
#region DeleteIdentityProvider
/// <summary>
/// Deletes an identity provider for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteIdentityProvider service method.</param>
///
/// <returns>The response from the DeleteIdentityProvider service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnsupportedIdentityProviderException">
/// This exception is thrown when the specified identifier is not supported.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteIdentityProvider">REST API Reference for DeleteIdentityProvider Operation</seealso>
public virtual DeleteIdentityProviderResponse DeleteIdentityProvider(DeleteIdentityProviderRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteIdentityProviderResponseUnmarshaller.Instance;
return Invoke<DeleteIdentityProviderResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteIdentityProvider operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteIdentityProvider operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteIdentityProvider
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteIdentityProvider">REST API Reference for DeleteIdentityProvider Operation</seealso>
public virtual IAsyncResult BeginDeleteIdentityProvider(DeleteIdentityProviderRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteIdentityProviderResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteIdentityProvider operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteIdentityProvider.</param>
///
/// <returns>Returns a DeleteIdentityProviderResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteIdentityProvider">REST API Reference for DeleteIdentityProvider Operation</seealso>
public virtual DeleteIdentityProviderResponse EndDeleteIdentityProvider(IAsyncResult asyncResult)
{
return EndInvoke<DeleteIdentityProviderResponse>(asyncResult);
}
#endregion
#region DeleteResourceServer
/// <summary>
/// Deletes a resource server.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteResourceServer service method.</param>
///
/// <returns>The response from the DeleteResourceServer service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteResourceServer">REST API Reference for DeleteResourceServer Operation</seealso>
public virtual DeleteResourceServerResponse DeleteResourceServer(DeleteResourceServerRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteResourceServerResponseUnmarshaller.Instance;
return Invoke<DeleteResourceServerResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteResourceServer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteResourceServer operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteResourceServer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteResourceServer">REST API Reference for DeleteResourceServer Operation</seealso>
public virtual IAsyncResult BeginDeleteResourceServer(DeleteResourceServerRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteResourceServerResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteResourceServer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteResourceServer.</param>
///
/// <returns>Returns a DeleteResourceServerResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteResourceServer">REST API Reference for DeleteResourceServer Operation</seealso>
public virtual DeleteResourceServerResponse EndDeleteResourceServer(IAsyncResult asyncResult)
{
return EndInvoke<DeleteResourceServerResponse>(asyncResult);
}
#endregion
#region DeleteUser
/// <summary>
/// Allows a user to delete himself or herself.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUser service method.</param>
///
/// <returns>The response from the DeleteUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUser">REST API Reference for DeleteUser Operation</seealso>
public virtual DeleteUserResponse DeleteUser(DeleteUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserResponseUnmarshaller.Instance;
return Invoke<DeleteUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUser">REST API Reference for DeleteUser Operation</seealso>
public virtual IAsyncResult BeginDeleteUser(DeleteUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUser.</param>
///
/// <returns>Returns a DeleteUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUser">REST API Reference for DeleteUser Operation</seealso>
public virtual DeleteUserResponse EndDeleteUser(IAsyncResult asyncResult)
{
return EndInvoke<DeleteUserResponse>(asyncResult);
}
#endregion
#region DeleteUserAttributes
/// <summary>
/// Deletes the attributes for a user.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUserAttributes service method.</param>
///
/// <returns>The response from the DeleteUserAttributes service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserAttributes">REST API Reference for DeleteUserAttributes Operation</seealso>
public virtual DeleteUserAttributesResponse DeleteUserAttributes(DeleteUserAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserAttributesResponseUnmarshaller.Instance;
return Invoke<DeleteUserAttributesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteUserAttributes operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUserAttributes operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUserAttributes
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserAttributes">REST API Reference for DeleteUserAttributes Operation</seealso>
public virtual IAsyncResult BeginDeleteUserAttributes(DeleteUserAttributesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserAttributesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteUserAttributes operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUserAttributes.</param>
///
/// <returns>Returns a DeleteUserAttributesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserAttributes">REST API Reference for DeleteUserAttributes Operation</seealso>
public virtual DeleteUserAttributesResponse EndDeleteUserAttributes(IAsyncResult asyncResult)
{
return EndInvoke<DeleteUserAttributesResponse>(asyncResult);
}
#endregion
#region DeleteUserPool
/// <summary>
/// Deletes the specified Amazon Cognito user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPool service method.</param>
///
/// <returns>The response from the DeleteUserPool service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserImportInProgressException">
/// This exception is thrown when you are trying to modify a user pool while a user import
/// job is in progress for that pool.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPool">REST API Reference for DeleteUserPool Operation</seealso>
public virtual DeleteUserPoolResponse DeleteUserPool(DeleteUserPoolRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolResponseUnmarshaller.Instance;
return Invoke<DeleteUserPoolResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteUserPool operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPool operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUserPool
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPool">REST API Reference for DeleteUserPool Operation</seealso>
public virtual IAsyncResult BeginDeleteUserPool(DeleteUserPoolRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteUserPool operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUserPool.</param>
///
/// <returns>Returns a DeleteUserPoolResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPool">REST API Reference for DeleteUserPool Operation</seealso>
public virtual DeleteUserPoolResponse EndDeleteUserPool(IAsyncResult asyncResult)
{
return EndInvoke<DeleteUserPoolResponse>(asyncResult);
}
#endregion
#region DeleteUserPoolClient
/// <summary>
/// Allows the developer to delete the user pool client.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPoolClient service method.</param>
///
/// <returns>The response from the DeleteUserPoolClient service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolClient">REST API Reference for DeleteUserPoolClient Operation</seealso>
public virtual DeleteUserPoolClientResponse DeleteUserPoolClient(DeleteUserPoolClientRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolClientResponseUnmarshaller.Instance;
return Invoke<DeleteUserPoolClientResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteUserPoolClient operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPoolClient operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUserPoolClient
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolClient">REST API Reference for DeleteUserPoolClient Operation</seealso>
public virtual IAsyncResult BeginDeleteUserPoolClient(DeleteUserPoolClientRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolClientResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteUserPoolClient operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUserPoolClient.</param>
///
/// <returns>Returns a DeleteUserPoolClientResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolClient">REST API Reference for DeleteUserPoolClient Operation</seealso>
public virtual DeleteUserPoolClientResponse EndDeleteUserPoolClient(IAsyncResult asyncResult)
{
return EndInvoke<DeleteUserPoolClientResponse>(asyncResult);
}
#endregion
#region DeleteUserPoolDomain
/// <summary>
/// Deletes a domain for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPoolDomain service method.</param>
///
/// <returns>The response from the DeleteUserPoolDomain service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolDomain">REST API Reference for DeleteUserPoolDomain Operation</seealso>
public virtual DeleteUserPoolDomainResponse DeleteUserPoolDomain(DeleteUserPoolDomainRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolDomainResponseUnmarshaller.Instance;
return Invoke<DeleteUserPoolDomainResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DeleteUserPoolDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DeleteUserPoolDomain operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeleteUserPoolDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolDomain">REST API Reference for DeleteUserPoolDomain Operation</seealso>
public virtual IAsyncResult BeginDeleteUserPoolDomain(DeleteUserPoolDomainRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteUserPoolDomainResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DeleteUserPoolDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDeleteUserPoolDomain.</param>
///
/// <returns>Returns a DeleteUserPoolDomainResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolDomain">REST API Reference for DeleteUserPoolDomain Operation</seealso>
public virtual DeleteUserPoolDomainResponse EndDeleteUserPoolDomain(IAsyncResult asyncResult)
{
return EndInvoke<DeleteUserPoolDomainResponse>(asyncResult);
}
#endregion
#region DescribeIdentityProvider
/// <summary>
/// Gets information about a specific identity provider.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeIdentityProvider service method.</param>
///
/// <returns>The response from the DescribeIdentityProvider service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeIdentityProvider">REST API Reference for DescribeIdentityProvider Operation</seealso>
public virtual DescribeIdentityProviderResponse DescribeIdentityProvider(DescribeIdentityProviderRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeIdentityProviderResponseUnmarshaller.Instance;
return Invoke<DescribeIdentityProviderResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeIdentityProvider operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeIdentityProvider operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeIdentityProvider
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeIdentityProvider">REST API Reference for DescribeIdentityProvider Operation</seealso>
public virtual IAsyncResult BeginDescribeIdentityProvider(DescribeIdentityProviderRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeIdentityProviderResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeIdentityProvider operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeIdentityProvider.</param>
///
/// <returns>Returns a DescribeIdentityProviderResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeIdentityProvider">REST API Reference for DescribeIdentityProvider Operation</seealso>
public virtual DescribeIdentityProviderResponse EndDescribeIdentityProvider(IAsyncResult asyncResult)
{
return EndInvoke<DescribeIdentityProviderResponse>(asyncResult);
}
#endregion
#region DescribeResourceServer
/// <summary>
/// Describes a resource server.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeResourceServer service method.</param>
///
/// <returns>The response from the DescribeResourceServer service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeResourceServer">REST API Reference for DescribeResourceServer Operation</seealso>
public virtual DescribeResourceServerResponse DescribeResourceServer(DescribeResourceServerRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeResourceServerResponseUnmarshaller.Instance;
return Invoke<DescribeResourceServerResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeResourceServer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeResourceServer operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeResourceServer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeResourceServer">REST API Reference for DescribeResourceServer Operation</seealso>
public virtual IAsyncResult BeginDescribeResourceServer(DescribeResourceServerRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeResourceServerResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeResourceServer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeResourceServer.</param>
///
/// <returns>Returns a DescribeResourceServerResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeResourceServer">REST API Reference for DescribeResourceServer Operation</seealso>
public virtual DescribeResourceServerResponse EndDescribeResourceServer(IAsyncResult asyncResult)
{
return EndInvoke<DescribeResourceServerResponse>(asyncResult);
}
#endregion
#region DescribeRiskConfiguration
/// <summary>
/// Describes the risk configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeRiskConfiguration service method.</param>
///
/// <returns>The response from the DescribeRiskConfiguration service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolAddOnNotEnabledException">
/// This exception is thrown when user pool add-ons are not enabled.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeRiskConfiguration">REST API Reference for DescribeRiskConfiguration Operation</seealso>
public virtual DescribeRiskConfigurationResponse DescribeRiskConfiguration(DescribeRiskConfigurationRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeRiskConfigurationRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeRiskConfigurationResponseUnmarshaller.Instance;
return Invoke<DescribeRiskConfigurationResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeRiskConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeRiskConfiguration operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeRiskConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeRiskConfiguration">REST API Reference for DescribeRiskConfiguration Operation</seealso>
public virtual IAsyncResult BeginDescribeRiskConfiguration(DescribeRiskConfigurationRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeRiskConfigurationRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeRiskConfigurationResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeRiskConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeRiskConfiguration.</param>
///
/// <returns>Returns a DescribeRiskConfigurationResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeRiskConfiguration">REST API Reference for DescribeRiskConfiguration Operation</seealso>
public virtual DescribeRiskConfigurationResponse EndDescribeRiskConfiguration(IAsyncResult asyncResult)
{
return EndInvoke<DescribeRiskConfigurationResponse>(asyncResult);
}
#endregion
#region DescribeUserImportJob
/// <summary>
/// Describes the user import job.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeUserImportJob service method.</param>
///
/// <returns>The response from the DescribeUserImportJob service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserImportJob">REST API Reference for DescribeUserImportJob Operation</seealso>
public virtual DescribeUserImportJobResponse DescribeUserImportJob(DescribeUserImportJobRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserImportJobResponseUnmarshaller.Instance;
return Invoke<DescribeUserImportJobResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeUserImportJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeUserImportJob operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeUserImportJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserImportJob">REST API Reference for DescribeUserImportJob Operation</seealso>
public virtual IAsyncResult BeginDescribeUserImportJob(DescribeUserImportJobRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserImportJobResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeUserImportJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeUserImportJob.</param>
///
/// <returns>Returns a DescribeUserImportJobResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserImportJob">REST API Reference for DescribeUserImportJob Operation</seealso>
public virtual DescribeUserImportJobResponse EndDescribeUserImportJob(IAsyncResult asyncResult)
{
return EndInvoke<DescribeUserImportJobResponse>(asyncResult);
}
#endregion
#region DescribeUserPool
/// <summary>
/// Returns the configuration information and metadata of the specified user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPool service method.</param>
///
/// <returns>The response from the DescribeUserPool service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolTaggingException">
/// This exception is thrown when a user pool tag cannot be set or updated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPool">REST API Reference for DescribeUserPool Operation</seealso>
public virtual DescribeUserPoolResponse DescribeUserPool(DescribeUserPoolRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolResponseUnmarshaller.Instance;
return Invoke<DescribeUserPoolResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeUserPool operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPool operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeUserPool
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPool">REST API Reference for DescribeUserPool Operation</seealso>
public virtual IAsyncResult BeginDescribeUserPool(DescribeUserPoolRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeUserPool operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeUserPool.</param>
///
/// <returns>Returns a DescribeUserPoolResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPool">REST API Reference for DescribeUserPool Operation</seealso>
public virtual DescribeUserPoolResponse EndDescribeUserPool(IAsyncResult asyncResult)
{
return EndInvoke<DescribeUserPoolResponse>(asyncResult);
}
#endregion
#region DescribeUserPoolClient
/// <summary>
/// Client method for returning the configuration information and metadata of the specified
/// user pool app client.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPoolClient service method.</param>
///
/// <returns>The response from the DescribeUserPoolClient service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolClient">REST API Reference for DescribeUserPoolClient Operation</seealso>
public virtual DescribeUserPoolClientResponse DescribeUserPoolClient(DescribeUserPoolClientRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolClientResponseUnmarshaller.Instance;
return Invoke<DescribeUserPoolClientResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeUserPoolClient operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPoolClient operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeUserPoolClient
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolClient">REST API Reference for DescribeUserPoolClient Operation</seealso>
public virtual IAsyncResult BeginDescribeUserPoolClient(DescribeUserPoolClientRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolClientResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeUserPoolClient operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeUserPoolClient.</param>
///
/// <returns>Returns a DescribeUserPoolClientResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolClient">REST API Reference for DescribeUserPoolClient Operation</seealso>
public virtual DescribeUserPoolClientResponse EndDescribeUserPoolClient(IAsyncResult asyncResult)
{
return EndInvoke<DescribeUserPoolClientResponse>(asyncResult);
}
#endregion
#region DescribeUserPoolDomain
/// <summary>
/// Gets information about a domain.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPoolDomain service method.</param>
///
/// <returns>The response from the DescribeUserPoolDomain service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolDomain">REST API Reference for DescribeUserPoolDomain Operation</seealso>
public virtual DescribeUserPoolDomainResponse DescribeUserPoolDomain(DescribeUserPoolDomainRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolDomainResponseUnmarshaller.Instance;
return Invoke<DescribeUserPoolDomainResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the DescribeUserPoolDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the DescribeUserPoolDomain operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeUserPoolDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolDomain">REST API Reference for DescribeUserPoolDomain Operation</seealso>
public virtual IAsyncResult BeginDescribeUserPoolDomain(DescribeUserPoolDomainRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeUserPoolDomainResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the DescribeUserPoolDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginDescribeUserPoolDomain.</param>
///
/// <returns>Returns a DescribeUserPoolDomainResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolDomain">REST API Reference for DescribeUserPoolDomain Operation</seealso>
public virtual DescribeUserPoolDomainResponse EndDescribeUserPoolDomain(IAsyncResult asyncResult)
{
return EndInvoke<DescribeUserPoolDomainResponse>(asyncResult);
}
#endregion
#region ForgetDevice
/// <summary>
/// Forgets the specified device.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ForgetDevice service method.</param>
///
/// <returns>The response from the ForgetDevice service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgetDevice">REST API Reference for ForgetDevice Operation</seealso>
public virtual ForgetDeviceResponse ForgetDevice(ForgetDeviceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ForgetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ForgetDeviceResponseUnmarshaller.Instance;
return Invoke<ForgetDeviceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ForgetDevice operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ForgetDevice operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndForgetDevice
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgetDevice">REST API Reference for ForgetDevice Operation</seealso>
public virtual IAsyncResult BeginForgetDevice(ForgetDeviceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ForgetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ForgetDeviceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ForgetDevice operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginForgetDevice.</param>
///
/// <returns>Returns a ForgetDeviceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgetDevice">REST API Reference for ForgetDevice Operation</seealso>
public virtual ForgetDeviceResponse EndForgetDevice(IAsyncResult asyncResult)
{
return EndInvoke<ForgetDeviceResponse>(asyncResult);
}
#endregion
#region ForgotPassword
/// <summary>
/// Calling this API causes a message to be sent to the end user with a confirmation code
/// that is required to change the user's password. For the <code>Username</code> parameter,
/// you can use the username or user alias. The method used to send the confirmation code
/// is sent according to the specified AccountRecoverySetting. For more information, see
/// <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-recover-a-user-account.html">Recovering
/// User Accounts</a> in the <i>Amazon Cognito Developer Guide</i>. If neither a verified
/// phone number nor a verified email exists, an <code>InvalidParameterException</code>
/// is thrown. To use the confirmation code for resetting the password, call <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ConfirmForgotPassword.html">ConfirmForgotPassword</a>.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ForgotPassword service method.</param>
///
/// <returns>The response from the ForgotPassword service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgotPassword">REST API Reference for ForgotPassword Operation</seealso>
public virtual ForgotPasswordResponse ForgotPassword(ForgotPasswordRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ForgotPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ForgotPasswordResponseUnmarshaller.Instance;
return Invoke<ForgotPasswordResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ForgotPassword operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ForgotPassword operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndForgotPassword
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgotPassword">REST API Reference for ForgotPassword Operation</seealso>
public virtual IAsyncResult BeginForgotPassword(ForgotPasswordRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ForgotPasswordRequestMarshaller.Instance;
options.ResponseUnmarshaller = ForgotPasswordResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ForgotPassword operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginForgotPassword.</param>
///
/// <returns>Returns a ForgotPasswordResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgotPassword">REST API Reference for ForgotPassword Operation</seealso>
public virtual ForgotPasswordResponse EndForgotPassword(IAsyncResult asyncResult)
{
return EndInvoke<ForgotPasswordResponse>(asyncResult);
}
#endregion
#region GetCSVHeader
/// <summary>
/// Gets the header information for the .csv file to be used as input for the user import
/// job.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetCSVHeader service method.</param>
///
/// <returns>The response from the GetCSVHeader service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetCSVHeader">REST API Reference for GetCSVHeader Operation</seealso>
public virtual GetCSVHeaderResponse GetCSVHeader(GetCSVHeaderRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetCSVHeaderRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetCSVHeaderResponseUnmarshaller.Instance;
return Invoke<GetCSVHeaderResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetCSVHeader operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetCSVHeader operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetCSVHeader
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetCSVHeader">REST API Reference for GetCSVHeader Operation</seealso>
public virtual IAsyncResult BeginGetCSVHeader(GetCSVHeaderRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetCSVHeaderRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetCSVHeaderResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetCSVHeader operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetCSVHeader.</param>
///
/// <returns>Returns a GetCSVHeaderResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetCSVHeader">REST API Reference for GetCSVHeader Operation</seealso>
public virtual GetCSVHeaderResponse EndGetCSVHeader(IAsyncResult asyncResult)
{
return EndInvoke<GetCSVHeaderResponse>(asyncResult);
}
#endregion
#region GetDevice
/// <summary>
/// Gets the device.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetDevice service method.</param>
///
/// <returns>The response from the GetDevice service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetDevice">REST API Reference for GetDevice Operation</seealso>
public virtual GetDeviceResponse GetDevice(GetDeviceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeviceResponseUnmarshaller.Instance;
return Invoke<GetDeviceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetDevice operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetDevice operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetDevice
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetDevice">REST API Reference for GetDevice Operation</seealso>
public virtual IAsyncResult BeginGetDevice(GetDeviceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetDeviceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetDeviceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetDevice operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetDevice.</param>
///
/// <returns>Returns a GetDeviceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetDevice">REST API Reference for GetDevice Operation</seealso>
public virtual GetDeviceResponse EndGetDevice(IAsyncResult asyncResult)
{
return EndInvoke<GetDeviceResponse>(asyncResult);
}
#endregion
#region GetGroup
/// <summary>
/// Gets a group.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetGroup service method.</param>
///
/// <returns>The response from the GetGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetGroup">REST API Reference for GetGroup Operation</seealso>
public virtual GetGroupResponse GetGroup(GetGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetGroupResponseUnmarshaller.Instance;
return Invoke<GetGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetGroup">REST API Reference for GetGroup Operation</seealso>
public virtual IAsyncResult BeginGetGroup(GetGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetGroup.</param>
///
/// <returns>Returns a GetGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetGroup">REST API Reference for GetGroup Operation</seealso>
public virtual GetGroupResponse EndGetGroup(IAsyncResult asyncResult)
{
return EndInvoke<GetGroupResponse>(asyncResult);
}
#endregion
#region GetIdentityProviderByIdentifier
/// <summary>
/// Gets the specified identity provider.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetIdentityProviderByIdentifier service method.</param>
///
/// <returns>The response from the GetIdentityProviderByIdentifier service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetIdentityProviderByIdentifier">REST API Reference for GetIdentityProviderByIdentifier Operation</seealso>
public virtual GetIdentityProviderByIdentifierResponse GetIdentityProviderByIdentifier(GetIdentityProviderByIdentifierRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetIdentityProviderByIdentifierRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetIdentityProviderByIdentifierResponseUnmarshaller.Instance;
return Invoke<GetIdentityProviderByIdentifierResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetIdentityProviderByIdentifier operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetIdentityProviderByIdentifier operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetIdentityProviderByIdentifier
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetIdentityProviderByIdentifier">REST API Reference for GetIdentityProviderByIdentifier Operation</seealso>
public virtual IAsyncResult BeginGetIdentityProviderByIdentifier(GetIdentityProviderByIdentifierRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetIdentityProviderByIdentifierRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetIdentityProviderByIdentifierResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetIdentityProviderByIdentifier operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetIdentityProviderByIdentifier.</param>
///
/// <returns>Returns a GetIdentityProviderByIdentifierResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetIdentityProviderByIdentifier">REST API Reference for GetIdentityProviderByIdentifier Operation</seealso>
public virtual GetIdentityProviderByIdentifierResponse EndGetIdentityProviderByIdentifier(IAsyncResult asyncResult)
{
return EndInvoke<GetIdentityProviderByIdentifierResponse>(asyncResult);
}
#endregion
#region GetSigningCertificate
/// <summary>
/// This method takes a user pool ID, and returns the signing certificate.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetSigningCertificate service method.</param>
///
/// <returns>The response from the GetSigningCertificate service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetSigningCertificate">REST API Reference for GetSigningCertificate Operation</seealso>
public virtual GetSigningCertificateResponse GetSigningCertificate(GetSigningCertificateRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetSigningCertificateRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetSigningCertificateResponseUnmarshaller.Instance;
return Invoke<GetSigningCertificateResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetSigningCertificate operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetSigningCertificate operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetSigningCertificate
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetSigningCertificate">REST API Reference for GetSigningCertificate Operation</seealso>
public virtual IAsyncResult BeginGetSigningCertificate(GetSigningCertificateRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetSigningCertificateRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetSigningCertificateResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetSigningCertificate operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetSigningCertificate.</param>
///
/// <returns>Returns a GetSigningCertificateResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetSigningCertificate">REST API Reference for GetSigningCertificate Operation</seealso>
public virtual GetSigningCertificateResponse EndGetSigningCertificate(IAsyncResult asyncResult)
{
return EndInvoke<GetSigningCertificateResponse>(asyncResult);
}
#endregion
#region GetUICustomization
/// <summary>
/// Gets the UI Customization information for a particular app client's app UI, if there
/// is something set. If nothing is set for the particular client, but there is an existing
/// pool level customization (app <code>clientId</code> will be <code>ALL</code>), then
/// that is returned. If nothing is present, then an empty shape is returned.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUICustomization service method.</param>
///
/// <returns>The response from the GetUICustomization service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUICustomization">REST API Reference for GetUICustomization Operation</seealso>
public virtual GetUICustomizationResponse GetUICustomization(GetUICustomizationRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUICustomizationRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUICustomizationResponseUnmarshaller.Instance;
return Invoke<GetUICustomizationResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetUICustomization operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUICustomization operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUICustomization
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUICustomization">REST API Reference for GetUICustomization Operation</seealso>
public virtual IAsyncResult BeginGetUICustomization(GetUICustomizationRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUICustomizationRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUICustomizationResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetUICustomization operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUICustomization.</param>
///
/// <returns>Returns a GetUICustomizationResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUICustomization">REST API Reference for GetUICustomization Operation</seealso>
public virtual GetUICustomizationResponse EndGetUICustomization(IAsyncResult asyncResult)
{
return EndInvoke<GetUICustomizationResponse>(asyncResult);
}
#endregion
#region GetUser
/// <summary>
/// Gets the user attributes and metadata for a user.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUser service method.</param>
///
/// <returns>The response from the GetUser service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUser">REST API Reference for GetUser Operation</seealso>
public virtual GetUserResponse GetUser(GetUserRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserResponseUnmarshaller.Instance;
return Invoke<GetUserResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetUser operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUser operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUser
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUser">REST API Reference for GetUser Operation</seealso>
public virtual IAsyncResult BeginGetUser(GetUserRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetUser operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUser.</param>
///
/// <returns>Returns a GetUserResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUser">REST API Reference for GetUser Operation</seealso>
public virtual GetUserResponse EndGetUser(IAsyncResult asyncResult)
{
return EndInvoke<GetUserResponse>(asyncResult);
}
#endregion
#region GetUserAttributeVerificationCode
/// <summary>
/// Gets the user attribute verification code for the specified attribute name.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUserAttributeVerificationCode service method.</param>
///
/// <returns>The response from the GetUserAttributeVerificationCode service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserAttributeVerificationCode">REST API Reference for GetUserAttributeVerificationCode Operation</seealso>
public virtual GetUserAttributeVerificationCodeResponse GetUserAttributeVerificationCode(GetUserAttributeVerificationCodeRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserAttributeVerificationCodeRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserAttributeVerificationCodeResponseUnmarshaller.Instance;
return Invoke<GetUserAttributeVerificationCodeResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetUserAttributeVerificationCode operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUserAttributeVerificationCode operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUserAttributeVerificationCode
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserAttributeVerificationCode">REST API Reference for GetUserAttributeVerificationCode Operation</seealso>
public virtual IAsyncResult BeginGetUserAttributeVerificationCode(GetUserAttributeVerificationCodeRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserAttributeVerificationCodeRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserAttributeVerificationCodeResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetUserAttributeVerificationCode operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUserAttributeVerificationCode.</param>
///
/// <returns>Returns a GetUserAttributeVerificationCodeResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserAttributeVerificationCode">REST API Reference for GetUserAttributeVerificationCode Operation</seealso>
public virtual GetUserAttributeVerificationCodeResponse EndGetUserAttributeVerificationCode(IAsyncResult asyncResult)
{
return EndInvoke<GetUserAttributeVerificationCodeResponse>(asyncResult);
}
#endregion
#region GetUserPoolMfaConfig
/// <summary>
/// Gets the user pool multi-factor authentication (MFA) configuration.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GetUserPoolMfaConfig service method.</param>
///
/// <returns>The response from the GetUserPoolMfaConfig service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserPoolMfaConfig">REST API Reference for GetUserPoolMfaConfig Operation</seealso>
public virtual GetUserPoolMfaConfigResponse GetUserPoolMfaConfig(GetUserPoolMfaConfigRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserPoolMfaConfigRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserPoolMfaConfigResponseUnmarshaller.Instance;
return Invoke<GetUserPoolMfaConfigResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GetUserPoolMfaConfig operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GetUserPoolMfaConfig operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGetUserPoolMfaConfig
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserPoolMfaConfig">REST API Reference for GetUserPoolMfaConfig Operation</seealso>
public virtual IAsyncResult BeginGetUserPoolMfaConfig(GetUserPoolMfaConfigRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetUserPoolMfaConfigRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetUserPoolMfaConfigResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GetUserPoolMfaConfig operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetUserPoolMfaConfig.</param>
///
/// <returns>Returns a GetUserPoolMfaConfigResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserPoolMfaConfig">REST API Reference for GetUserPoolMfaConfig Operation</seealso>
public virtual GetUserPoolMfaConfigResponse EndGetUserPoolMfaConfig(IAsyncResult asyncResult)
{
return EndInvoke<GetUserPoolMfaConfigResponse>(asyncResult);
}
#endregion
#region GlobalSignOut
/// <summary>
/// Signs out users from all devices. It also invalidates all refresh tokens issued to
/// a user. The user's current access and Id tokens remain valid until their expiry. Access
/// and Id tokens expire one hour after they are issued.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the GlobalSignOut service method.</param>
///
/// <returns>The response from the GlobalSignOut service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GlobalSignOut">REST API Reference for GlobalSignOut Operation</seealso>
public virtual GlobalSignOutResponse GlobalSignOut(GlobalSignOutRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GlobalSignOutRequestMarshaller.Instance;
options.ResponseUnmarshaller = GlobalSignOutResponseUnmarshaller.Instance;
return Invoke<GlobalSignOutResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the GlobalSignOut operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the GlobalSignOut operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndGlobalSignOut
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GlobalSignOut">REST API Reference for GlobalSignOut Operation</seealso>
public virtual IAsyncResult BeginGlobalSignOut(GlobalSignOutRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = GlobalSignOutRequestMarshaller.Instance;
options.ResponseUnmarshaller = GlobalSignOutResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the GlobalSignOut operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginGlobalSignOut.</param>
///
/// <returns>Returns a GlobalSignOutResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GlobalSignOut">REST API Reference for GlobalSignOut Operation</seealso>
public virtual GlobalSignOutResponse EndGlobalSignOut(IAsyncResult asyncResult)
{
return EndInvoke<GlobalSignOutResponse>(asyncResult);
}
#endregion
#region InitiateAuth
/// <summary>
/// Initiates the authentication flow.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the InitiateAuth service method.</param>
///
/// <returns>The response from the InitiateAuth service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/InitiateAuth">REST API Reference for InitiateAuth Operation</seealso>
public virtual InitiateAuthResponse InitiateAuth(InitiateAuthRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = InitiateAuthRequestMarshaller.Instance;
options.ResponseUnmarshaller = InitiateAuthResponseUnmarshaller.Instance;
return Invoke<InitiateAuthResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the InitiateAuth operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the InitiateAuth operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndInitiateAuth
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/InitiateAuth">REST API Reference for InitiateAuth Operation</seealso>
public virtual IAsyncResult BeginInitiateAuth(InitiateAuthRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = InitiateAuthRequestMarshaller.Instance;
options.ResponseUnmarshaller = InitiateAuthResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the InitiateAuth operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginInitiateAuth.</param>
///
/// <returns>Returns a InitiateAuthResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/InitiateAuth">REST API Reference for InitiateAuth Operation</seealso>
public virtual InitiateAuthResponse EndInitiateAuth(IAsyncResult asyncResult)
{
return EndInvoke<InitiateAuthResponse>(asyncResult);
}
#endregion
#region ListDevices
/// <summary>
/// Lists the devices.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListDevices service method.</param>
///
/// <returns>The response from the ListDevices service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListDevices">REST API Reference for ListDevices Operation</seealso>
public virtual ListDevicesResponse ListDevices(ListDevicesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListDevicesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListDevicesResponseUnmarshaller.Instance;
return Invoke<ListDevicesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListDevices operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListDevices operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListDevices
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListDevices">REST API Reference for ListDevices Operation</seealso>
public virtual IAsyncResult BeginListDevices(ListDevicesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListDevicesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListDevicesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListDevices operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListDevices.</param>
///
/// <returns>Returns a ListDevicesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListDevices">REST API Reference for ListDevices Operation</seealso>
public virtual ListDevicesResponse EndListDevices(IAsyncResult asyncResult)
{
return EndInvoke<ListDevicesResponse>(asyncResult);
}
#endregion
#region ListGroups
/// <summary>
/// Lists the groups associated with a user pool.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListGroups service method.</param>
///
/// <returns>The response from the ListGroups service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListGroups">REST API Reference for ListGroups Operation</seealso>
public virtual ListGroupsResponse ListGroups(ListGroupsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListGroupsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListGroupsResponseUnmarshaller.Instance;
return Invoke<ListGroupsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListGroups operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListGroups operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListGroups
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListGroups">REST API Reference for ListGroups Operation</seealso>
public virtual IAsyncResult BeginListGroups(ListGroupsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListGroupsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListGroupsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListGroups operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListGroups.</param>
///
/// <returns>Returns a ListGroupsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListGroups">REST API Reference for ListGroups Operation</seealso>
public virtual ListGroupsResponse EndListGroups(IAsyncResult asyncResult)
{
return EndInvoke<ListGroupsResponse>(asyncResult);
}
#endregion
#region ListIdentityProviders
/// <summary>
/// Lists information about all identity providers for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListIdentityProviders service method.</param>
///
/// <returns>The response from the ListIdentityProviders service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListIdentityProviders">REST API Reference for ListIdentityProviders Operation</seealso>
public virtual ListIdentityProvidersResponse ListIdentityProviders(ListIdentityProvidersRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListIdentityProvidersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListIdentityProvidersResponseUnmarshaller.Instance;
return Invoke<ListIdentityProvidersResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListIdentityProviders operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListIdentityProviders operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListIdentityProviders
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListIdentityProviders">REST API Reference for ListIdentityProviders Operation</seealso>
public virtual IAsyncResult BeginListIdentityProviders(ListIdentityProvidersRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListIdentityProvidersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListIdentityProvidersResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListIdentityProviders operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListIdentityProviders.</param>
///
/// <returns>Returns a ListIdentityProvidersResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListIdentityProviders">REST API Reference for ListIdentityProviders Operation</seealso>
public virtual ListIdentityProvidersResponse EndListIdentityProviders(IAsyncResult asyncResult)
{
return EndInvoke<ListIdentityProvidersResponse>(asyncResult);
}
#endregion
#region ListResourceServers
/// <summary>
/// Lists the resource servers for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListResourceServers service method.</param>
///
/// <returns>The response from the ListResourceServers service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListResourceServers">REST API Reference for ListResourceServers Operation</seealso>
public virtual ListResourceServersResponse ListResourceServers(ListResourceServersRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListResourceServersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListResourceServersResponseUnmarshaller.Instance;
return Invoke<ListResourceServersResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListResourceServers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListResourceServers operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListResourceServers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListResourceServers">REST API Reference for ListResourceServers Operation</seealso>
public virtual IAsyncResult BeginListResourceServers(ListResourceServersRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListResourceServersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListResourceServersResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListResourceServers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListResourceServers.</param>
///
/// <returns>Returns a ListResourceServersResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListResourceServers">REST API Reference for ListResourceServers Operation</seealso>
public virtual ListResourceServersResponse EndListResourceServers(IAsyncResult asyncResult)
{
return EndInvoke<ListResourceServersResponse>(asyncResult);
}
#endregion
#region ListTagsForResource
/// <summary>
/// Lists the tags that are assigned to an Amazon Cognito user pool.
///
///
/// <para>
/// A tag is a label that you can apply to user pools to categorize and manage them in
/// different ways, such as by purpose, owner, environment, or other criteria.
/// </para>
///
/// <para>
/// You can use this action up to 10 times per second, per account.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListTagsForResource service method.</param>
///
/// <returns>The response from the ListTagsForResource service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/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>
/// Initiates the asynchronous execution of the ListTagsForResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListTagsForResource operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListTagsForResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso>
public virtual IAsyncResult BeginListTagsForResource(ListTagsForResourceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListTagsForResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListTagsForResource.</param>
///
/// <returns>Returns a ListTagsForResourceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListTagsForResource">REST API Reference for ListTagsForResource Operation</seealso>
public virtual ListTagsForResourceResponse EndListTagsForResource(IAsyncResult asyncResult)
{
return EndInvoke<ListTagsForResourceResponse>(asyncResult);
}
#endregion
#region ListUserImportJobs
/// <summary>
/// Lists the user import jobs.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListUserImportJobs service method.</param>
///
/// <returns>The response from the ListUserImportJobs service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserImportJobs">REST API Reference for ListUserImportJobs Operation</seealso>
public virtual ListUserImportJobsResponse ListUserImportJobs(ListUserImportJobsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserImportJobsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserImportJobsResponseUnmarshaller.Instance;
return Invoke<ListUserImportJobsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListUserImportJobs operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListUserImportJobs operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListUserImportJobs
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserImportJobs">REST API Reference for ListUserImportJobs Operation</seealso>
public virtual IAsyncResult BeginListUserImportJobs(ListUserImportJobsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserImportJobsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserImportJobsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListUserImportJobs operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListUserImportJobs.</param>
///
/// <returns>Returns a ListUserImportJobsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserImportJobs">REST API Reference for ListUserImportJobs Operation</seealso>
public virtual ListUserImportJobsResponse EndListUserImportJobs(IAsyncResult asyncResult)
{
return EndInvoke<ListUserImportJobsResponse>(asyncResult);
}
#endregion
#region ListUserPoolClients
/// <summary>
/// Lists the clients that have been created for the specified user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListUserPoolClients service method.</param>
///
/// <returns>The response from the ListUserPoolClients service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPoolClients">REST API Reference for ListUserPoolClients Operation</seealso>
public virtual ListUserPoolClientsResponse ListUserPoolClients(ListUserPoolClientsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserPoolClientsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserPoolClientsResponseUnmarshaller.Instance;
return Invoke<ListUserPoolClientsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListUserPoolClients operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListUserPoolClients operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListUserPoolClients
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPoolClients">REST API Reference for ListUserPoolClients Operation</seealso>
public virtual IAsyncResult BeginListUserPoolClients(ListUserPoolClientsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserPoolClientsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserPoolClientsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListUserPoolClients operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListUserPoolClients.</param>
///
/// <returns>Returns a ListUserPoolClientsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPoolClients">REST API Reference for ListUserPoolClients Operation</seealso>
public virtual ListUserPoolClientsResponse EndListUserPoolClients(IAsyncResult asyncResult)
{
return EndInvoke<ListUserPoolClientsResponse>(asyncResult);
}
#endregion
#region ListUserPools
/// <summary>
/// Lists the user pools associated with an account.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListUserPools service method.</param>
///
/// <returns>The response from the ListUserPools service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPools">REST API Reference for ListUserPools Operation</seealso>
public virtual ListUserPoolsResponse ListUserPools(ListUserPoolsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserPoolsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserPoolsResponseUnmarshaller.Instance;
return Invoke<ListUserPoolsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListUserPools operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListUserPools operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListUserPools
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPools">REST API Reference for ListUserPools Operation</seealso>
public virtual IAsyncResult BeginListUserPools(ListUserPoolsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUserPoolsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUserPoolsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListUserPools operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListUserPools.</param>
///
/// <returns>Returns a ListUserPoolsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPools">REST API Reference for ListUserPools Operation</seealso>
public virtual ListUserPoolsResponse EndListUserPools(IAsyncResult asyncResult)
{
return EndInvoke<ListUserPoolsResponse>(asyncResult);
}
#endregion
#region ListUsers
/// <summary>
/// Lists the users in the Amazon Cognito user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListUsers service method.</param>
///
/// <returns>The response from the ListUsers service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsers">REST API Reference for ListUsers Operation</seealso>
public virtual ListUsersResponse ListUsers(ListUsersRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUsersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUsersResponseUnmarshaller.Instance;
return Invoke<ListUsersResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListUsers operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListUsers operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListUsers
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsers">REST API Reference for ListUsers Operation</seealso>
public virtual IAsyncResult BeginListUsers(ListUsersRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUsersRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUsersResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListUsers operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListUsers.</param>
///
/// <returns>Returns a ListUsersResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsers">REST API Reference for ListUsers Operation</seealso>
public virtual ListUsersResponse EndListUsers(IAsyncResult asyncResult)
{
return EndInvoke<ListUsersResponse>(asyncResult);
}
#endregion
#region ListUsersInGroup
/// <summary>
/// Lists the users in the specified group.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ListUsersInGroup service method.</param>
///
/// <returns>The response from the ListUsersInGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsersInGroup">REST API Reference for ListUsersInGroup Operation</seealso>
public virtual ListUsersInGroupResponse ListUsersInGroup(ListUsersInGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUsersInGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUsersInGroupResponseUnmarshaller.Instance;
return Invoke<ListUsersInGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ListUsersInGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ListUsersInGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndListUsersInGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsersInGroup">REST API Reference for ListUsersInGroup Operation</seealso>
public virtual IAsyncResult BeginListUsersInGroup(ListUsersInGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListUsersInGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListUsersInGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ListUsersInGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginListUsersInGroup.</param>
///
/// <returns>Returns a ListUsersInGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsersInGroup">REST API Reference for ListUsersInGroup Operation</seealso>
public virtual ListUsersInGroupResponse EndListUsersInGroup(IAsyncResult asyncResult)
{
return EndInvoke<ListUsersInGroupResponse>(asyncResult);
}
#endregion
#region ResendConfirmationCode
/// <summary>
/// Resends the confirmation (for confirmation of registration) to a specific user in
/// the user pool.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the ResendConfirmationCode service method.</param>
///
/// <returns>The response from the ResendConfirmationCode service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ResendConfirmationCode">REST API Reference for ResendConfirmationCode Operation</seealso>
public virtual ResendConfirmationCodeResponse ResendConfirmationCode(ResendConfirmationCodeRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ResendConfirmationCodeRequestMarshaller.Instance;
options.ResponseUnmarshaller = ResendConfirmationCodeResponseUnmarshaller.Instance;
return Invoke<ResendConfirmationCodeResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the ResendConfirmationCode operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the ResendConfirmationCode operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndResendConfirmationCode
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ResendConfirmationCode">REST API Reference for ResendConfirmationCode Operation</seealso>
public virtual IAsyncResult BeginResendConfirmationCode(ResendConfirmationCodeRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = ResendConfirmationCodeRequestMarshaller.Instance;
options.ResponseUnmarshaller = ResendConfirmationCodeResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the ResendConfirmationCode operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginResendConfirmationCode.</param>
///
/// <returns>Returns a ResendConfirmationCodeResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ResendConfirmationCode">REST API Reference for ResendConfirmationCode Operation</seealso>
public virtual ResendConfirmationCodeResponse EndResendConfirmationCode(IAsyncResult asyncResult)
{
return EndInvoke<ResendConfirmationCodeResponse>(asyncResult);
}
#endregion
#region RespondToAuthChallenge
/// <summary>
/// Responds to the authentication challenge.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RespondToAuthChallenge service method.</param>
///
/// <returns>The response from the RespondToAuthChallenge service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.MFAMethodNotFoundException">
/// This exception is thrown when Amazon Cognito cannot find a multi-factor authentication
/// (MFA) method.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.SoftwareTokenMFANotFoundException">
/// This exception is thrown when the software token TOTP multi-factor authentication
/// (MFA) is not enabled for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RespondToAuthChallenge">REST API Reference for RespondToAuthChallenge Operation</seealso>
public virtual RespondToAuthChallengeResponse RespondToAuthChallenge(RespondToAuthChallengeRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = RespondToAuthChallengeRequestMarshaller.Instance;
options.ResponseUnmarshaller = RespondToAuthChallengeResponseUnmarshaller.Instance;
return Invoke<RespondToAuthChallengeResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the RespondToAuthChallenge operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RespondToAuthChallenge operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRespondToAuthChallenge
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RespondToAuthChallenge">REST API Reference for RespondToAuthChallenge Operation</seealso>
public virtual IAsyncResult BeginRespondToAuthChallenge(RespondToAuthChallengeRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = RespondToAuthChallengeRequestMarshaller.Instance;
options.ResponseUnmarshaller = RespondToAuthChallengeResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the RespondToAuthChallenge operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginRespondToAuthChallenge.</param>
///
/// <returns>Returns a RespondToAuthChallengeResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RespondToAuthChallenge">REST API Reference for RespondToAuthChallenge Operation</seealso>
public virtual RespondToAuthChallengeResponse EndRespondToAuthChallenge(IAsyncResult asyncResult)
{
return EndInvoke<RespondToAuthChallengeResponse>(asyncResult);
}
#endregion
#region RevokeToken
/// <summary>
/// Revokes all of the access tokens generated by the specified refresh token. After the
/// token is revoked, you can not use the revoked token to access Cognito authenticated
/// APIs.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RevokeToken service method.</param>
///
/// <returns>The response from the RevokeToken service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnauthorizedException">
/// This exception is thrown when the request is not authorized. This can happen due to
/// an invalid access token in the request.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnsupportedOperationException">
/// This exception is thrown when you attempt to perform an operation that is not enabled
/// for the user pool client.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnsupportedTokenTypeException">
/// This exception is thrown when an unsupported token is passed to an operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RevokeToken">REST API Reference for RevokeToken Operation</seealso>
public virtual RevokeTokenResponse RevokeToken(RevokeTokenRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = RevokeTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = RevokeTokenResponseUnmarshaller.Instance;
return Invoke<RevokeTokenResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the RevokeToken operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the RevokeToken operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndRevokeToken
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RevokeToken">REST API Reference for RevokeToken Operation</seealso>
public virtual IAsyncResult BeginRevokeToken(RevokeTokenRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = RevokeTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = RevokeTokenResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the RevokeToken operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginRevokeToken.</param>
///
/// <returns>Returns a RevokeTokenResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/RevokeToken">REST API Reference for RevokeToken Operation</seealso>
public virtual RevokeTokenResponse EndRevokeToken(IAsyncResult asyncResult)
{
return EndInvoke<RevokeTokenResponse>(asyncResult);
}
#endregion
#region SetRiskConfiguration
/// <summary>
/// Configures actions on detected risks. To delete the risk configuration for <code>UserPoolId</code>
/// or <code>ClientId</code>, pass null values for all four configuration types.
///
///
/// <para>
/// To enable Amazon Cognito advanced security features, update the user pool to include
/// the <code>UserPoolAddOns</code> key<code>AdvancedSecurityMode</code>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SetRiskConfiguration service method.</param>
///
/// <returns>The response from the SetRiskConfiguration service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolAddOnNotEnabledException">
/// This exception is thrown when user pool add-ons are not enabled.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetRiskConfiguration">REST API Reference for SetRiskConfiguration Operation</seealso>
public virtual SetRiskConfigurationResponse SetRiskConfiguration(SetRiskConfigurationRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetRiskConfigurationRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetRiskConfigurationResponseUnmarshaller.Instance;
return Invoke<SetRiskConfigurationResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SetRiskConfiguration operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetRiskConfiguration operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetRiskConfiguration
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetRiskConfiguration">REST API Reference for SetRiskConfiguration Operation</seealso>
public virtual IAsyncResult BeginSetRiskConfiguration(SetRiskConfigurationRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetRiskConfigurationRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetRiskConfigurationResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SetRiskConfiguration operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSetRiskConfiguration.</param>
///
/// <returns>Returns a SetRiskConfigurationResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetRiskConfiguration">REST API Reference for SetRiskConfiguration Operation</seealso>
public virtual SetRiskConfigurationResponse EndSetRiskConfiguration(IAsyncResult asyncResult)
{
return EndInvoke<SetRiskConfigurationResponse>(asyncResult);
}
#endregion
#region SetUICustomization
/// <summary>
/// Sets the UI customization information for a user pool's built-in app UI.
///
///
/// <para>
/// You can specify app UI customization settings for a single client (with a specific
/// <code>clientId</code>) or for all clients (by setting the <code>clientId</code> to
/// <code>ALL</code>). If you specify <code>ALL</code>, the default configuration will
/// be used for every client that has no UI customization set previously. If you specify
/// UI customization settings for a particular client, it will no longer fall back to
/// the <code>ALL</code> configuration.
/// </para>
/// <note>
/// <para>
/// To use this API, your user pool must have a domain associated with it. Otherwise,
/// there is no place to host the app's pages, and the service will throw an error.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SetUICustomization service method.</param>
///
/// <returns>The response from the SetUICustomization service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUICustomization">REST API Reference for SetUICustomization Operation</seealso>
public virtual SetUICustomizationResponse SetUICustomization(SetUICustomizationRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUICustomizationRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUICustomizationResponseUnmarshaller.Instance;
return Invoke<SetUICustomizationResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SetUICustomization operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetUICustomization operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetUICustomization
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUICustomization">REST API Reference for SetUICustomization Operation</seealso>
public virtual IAsyncResult BeginSetUICustomization(SetUICustomizationRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUICustomizationRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUICustomizationResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SetUICustomization operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSetUICustomization.</param>
///
/// <returns>Returns a SetUICustomizationResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUICustomization">REST API Reference for SetUICustomization Operation</seealso>
public virtual SetUICustomizationResponse EndSetUICustomization(IAsyncResult asyncResult)
{
return EndInvoke<SetUICustomizationResponse>(asyncResult);
}
#endregion
#region SetUserMFAPreference
/// <summary>
/// Set the user's multi-factor authentication (MFA) method preference, including which
/// MFA factors are enabled and if any are preferred. Only one factor can be set as preferred.
/// The preferred MFA factor will be used to authenticate a user if multiple factors are
/// enabled. If multiple options are enabled and no preference is set, a challenge to
/// choose an MFA option will be returned during sign in. If an MFA type is enabled for
/// a user, the user will be prompted for MFA during all sign in attempts, unless device
/// tracking is turned on and the device has been trusted. If you would like MFA to be
/// applied selectively based on the assessed risk level of sign in attempts, disable
/// MFA for users and turn on Adaptive Authentication for the user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SetUserMFAPreference service method.</param>
///
/// <returns>The response from the SetUserMFAPreference service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserMFAPreference">REST API Reference for SetUserMFAPreference Operation</seealso>
public virtual SetUserMFAPreferenceResponse SetUserMFAPreference(SetUserMFAPreferenceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserMFAPreferenceRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserMFAPreferenceResponseUnmarshaller.Instance;
return Invoke<SetUserMFAPreferenceResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SetUserMFAPreference operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetUserMFAPreference operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetUserMFAPreference
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserMFAPreference">REST API Reference for SetUserMFAPreference Operation</seealso>
public virtual IAsyncResult BeginSetUserMFAPreference(SetUserMFAPreferenceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserMFAPreferenceRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserMFAPreferenceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SetUserMFAPreference operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSetUserMFAPreference.</param>
///
/// <returns>Returns a SetUserMFAPreferenceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserMFAPreference">REST API Reference for SetUserMFAPreference Operation</seealso>
public virtual SetUserMFAPreferenceResponse EndSetUserMFAPreference(IAsyncResult asyncResult)
{
return EndInvoke<SetUserMFAPreferenceResponse>(asyncResult);
}
#endregion
#region SetUserPoolMfaConfig
/// <summary>
/// Set the user pool multi-factor authentication (MFA) configuration.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SetUserPoolMfaConfig service method.</param>
///
/// <returns>The response from the SetUserPoolMfaConfig service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserPoolMfaConfig">REST API Reference for SetUserPoolMfaConfig Operation</seealso>
public virtual SetUserPoolMfaConfigResponse SetUserPoolMfaConfig(SetUserPoolMfaConfigRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserPoolMfaConfigRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserPoolMfaConfigResponseUnmarshaller.Instance;
return Invoke<SetUserPoolMfaConfigResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SetUserPoolMfaConfig operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetUserPoolMfaConfig operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetUserPoolMfaConfig
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserPoolMfaConfig">REST API Reference for SetUserPoolMfaConfig Operation</seealso>
public virtual IAsyncResult BeginSetUserPoolMfaConfig(SetUserPoolMfaConfigRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserPoolMfaConfigRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserPoolMfaConfigResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SetUserPoolMfaConfig operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSetUserPoolMfaConfig.</param>
///
/// <returns>Returns a SetUserPoolMfaConfigResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserPoolMfaConfig">REST API Reference for SetUserPoolMfaConfig Operation</seealso>
public virtual SetUserPoolMfaConfigResponse EndSetUserPoolMfaConfig(IAsyncResult asyncResult)
{
return EndInvoke<SetUserPoolMfaConfigResponse>(asyncResult);
}
#endregion
#region SetUserSettings
/// <summary>
/// <i>This action is no longer supported.</i> You can use it to configure only SMS MFA.
/// You can't use it to configure TOTP software token MFA. To configure either type of
/// MFA, use <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_SetUserMFAPreference.html">SetUserMFAPreference</a>
/// instead.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SetUserSettings service method.</param>
///
/// <returns>The response from the SetUserSettings service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserSettings">REST API Reference for SetUserSettings Operation</seealso>
public virtual SetUserSettingsResponse SetUserSettings(SetUserSettingsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserSettingsResponseUnmarshaller.Instance;
return Invoke<SetUserSettingsResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SetUserSettings operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SetUserSettings operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetUserSettings
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserSettings">REST API Reference for SetUserSettings Operation</seealso>
public virtual IAsyncResult BeginSetUserSettings(SetUserSettingsRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetUserSettingsRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetUserSettingsResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SetUserSettings operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSetUserSettings.</param>
///
/// <returns>Returns a SetUserSettingsResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserSettings">REST API Reference for SetUserSettings Operation</seealso>
public virtual SetUserSettingsResponse EndSetUserSettings(IAsyncResult asyncResult)
{
return EndInvoke<SetUserSettingsResponse>(asyncResult);
}
#endregion
#region SignUp
/// <summary>
/// Registers the user in the specified user pool and creates a user name, password, and
/// user attributes.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the SignUp service method.</param>
///
/// <returns>The response from the SignUp service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidPasswordException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid password.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UsernameExistsException">
/// This exception is thrown when Amazon Cognito encounters a user name that already exists
/// in the user pool.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SignUp">REST API Reference for SignUp Operation</seealso>
public virtual SignUpResponse SignUp(SignUpRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = SignUpResponseUnmarshaller.Instance;
return Invoke<SignUpResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the SignUp operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the SignUp operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSignUp
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SignUp">REST API Reference for SignUp Operation</seealso>
public virtual IAsyncResult BeginSignUp(SignUpRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = SignUpRequestMarshaller.Instance;
options.ResponseUnmarshaller = SignUpResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the SignUp operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginSignUp.</param>
///
/// <returns>Returns a SignUpResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SignUp">REST API Reference for SignUp Operation</seealso>
public virtual SignUpResponse EndSignUp(IAsyncResult asyncResult)
{
return EndInvoke<SignUpResponse>(asyncResult);
}
#endregion
#region StartUserImportJob
/// <summary>
/// Starts the user import.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StartUserImportJob service method.</param>
///
/// <returns>The response from the StartUserImportJob service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PreconditionNotMetException">
/// This exception is thrown when a precondition is not met.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StartUserImportJob">REST API Reference for StartUserImportJob Operation</seealso>
public virtual StartUserImportJobResponse StartUserImportJob(StartUserImportJobRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartUserImportJobResponseUnmarshaller.Instance;
return Invoke<StartUserImportJobResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the StartUserImportJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StartUserImportJob operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStartUserImportJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StartUserImportJob">REST API Reference for StartUserImportJob Operation</seealso>
public virtual IAsyncResult BeginStartUserImportJob(StartUserImportJobRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartUserImportJobResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StartUserImportJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStartUserImportJob.</param>
///
/// <returns>Returns a StartUserImportJobResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StartUserImportJob">REST API Reference for StartUserImportJob Operation</seealso>
public virtual StartUserImportJobResponse EndStartUserImportJob(IAsyncResult asyncResult)
{
return EndInvoke<StartUserImportJobResponse>(asyncResult);
}
#endregion
#region StopUserImportJob
/// <summary>
/// Stops the user import job.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the StopUserImportJob service method.</param>
///
/// <returns>The response from the StopUserImportJob service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PreconditionNotMetException">
/// This exception is thrown when a precondition is not met.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StopUserImportJob">REST API Reference for StopUserImportJob Operation</seealso>
public virtual StopUserImportJobResponse StopUserImportJob(StopUserImportJobRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StopUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = StopUserImportJobResponseUnmarshaller.Instance;
return Invoke<StopUserImportJobResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the StopUserImportJob operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the StopUserImportJob operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndStopUserImportJob
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StopUserImportJob">REST API Reference for StopUserImportJob Operation</seealso>
public virtual IAsyncResult BeginStopUserImportJob(StopUserImportJobRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = StopUserImportJobRequestMarshaller.Instance;
options.ResponseUnmarshaller = StopUserImportJobResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the StopUserImportJob operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginStopUserImportJob.</param>
///
/// <returns>Returns a StopUserImportJobResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StopUserImportJob">REST API Reference for StopUserImportJob Operation</seealso>
public virtual StopUserImportJobResponse EndStopUserImportJob(IAsyncResult asyncResult)
{
return EndInvoke<StopUserImportJobResponse>(asyncResult);
}
#endregion
#region TagResource
/// <summary>
/// Assigns a set of tags to an Amazon Cognito user pool. A tag is a label that you can
/// use to categorize and manage user pools in different ways, such as by purpose, owner,
/// environment, or other criteria.
///
///
/// <para>
/// Each tag consists of a key and value, both of which you define. A key is a general
/// category for more specific values. For example, if you have two versions of a user
/// pool, one for testing and another for production, you might assign an <code>Environment</code>
/// tag key to both user pools. The value of this key might be <code>Test</code> for one
/// user pool and <code>Production</code> for the other.
/// </para>
///
/// <para>
/// Tags are useful for cost tracking and access control. You can activate your tags so
/// that they appear on the Billing and Cost Management console, where you can track the
/// costs associated with your user pools. In an IAM policy, you can constrain permissions
/// for user pools based on specific tags or tag values.
/// </para>
///
/// <para>
/// You can use this action up to 5 times per second, per account. A user pool can have
/// as many as 50 tags.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the TagResource service method.</param>
///
/// <returns>The response from the TagResource service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/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>
/// Initiates the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the TagResource operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndTagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/TagResource">REST API Reference for TagResource Operation</seealso>
public virtual IAsyncResult BeginTagResource(TagResourceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = TagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the TagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginTagResource.</param>
///
/// <returns>Returns a TagResourceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/TagResource">REST API Reference for TagResource Operation</seealso>
public virtual TagResourceResponse EndTagResource(IAsyncResult asyncResult)
{
return EndInvoke<TagResourceResponse>(asyncResult);
}
#endregion
#region UntagResource
/// <summary>
/// Removes the specified tags from an Amazon Cognito user pool. You can use this action
/// up to 5 times per second, per account
/// </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 CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/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>
/// Initiates the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UntagResource operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUntagResource
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UntagResource">REST API Reference for UntagResource Operation</seealso>
public virtual IAsyncResult BeginUntagResource(UntagResourceRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UntagResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UntagResource operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUntagResource.</param>
///
/// <returns>Returns a UntagResourceResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UntagResource">REST API Reference for UntagResource Operation</seealso>
public virtual UntagResourceResponse EndUntagResource(IAsyncResult asyncResult)
{
return EndInvoke<UntagResourceResponse>(asyncResult);
}
#endregion
#region UpdateAuthEventFeedback
/// <summary>
/// Provides the feedback for an authentication event whether it was from a valid user
/// or not. This feedback is used for improving the risk evaluation decision for the user
/// pool as part of Amazon Cognito advanced security.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateAuthEventFeedback service method.</param>
///
/// <returns>The response from the UpdateAuthEventFeedback service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolAddOnNotEnabledException">
/// This exception is thrown when user pool add-ons are not enabled.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateAuthEventFeedback">REST API Reference for UpdateAuthEventFeedback Operation</seealso>
public virtual UpdateAuthEventFeedbackResponse UpdateAuthEventFeedback(UpdateAuthEventFeedbackRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateAuthEventFeedbackRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateAuthEventFeedbackResponseUnmarshaller.Instance;
return Invoke<UpdateAuthEventFeedbackResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateAuthEventFeedback operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateAuthEventFeedback operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateAuthEventFeedback
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateAuthEventFeedback">REST API Reference for UpdateAuthEventFeedback Operation</seealso>
public virtual IAsyncResult BeginUpdateAuthEventFeedback(UpdateAuthEventFeedbackRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateAuthEventFeedbackRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateAuthEventFeedbackResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateAuthEventFeedback operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateAuthEventFeedback.</param>
///
/// <returns>Returns a UpdateAuthEventFeedbackResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateAuthEventFeedback">REST API Reference for UpdateAuthEventFeedback Operation</seealso>
public virtual UpdateAuthEventFeedbackResponse EndUpdateAuthEventFeedback(IAsyncResult asyncResult)
{
return EndInvoke<UpdateAuthEventFeedbackResponse>(asyncResult);
}
#endregion
#region UpdateDeviceStatus
/// <summary>
/// Updates the device status.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateDeviceStatus service method.</param>
///
/// <returns>The response from the UpdateDeviceStatus service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateDeviceStatus">REST API Reference for UpdateDeviceStatus Operation</seealso>
public virtual UpdateDeviceStatusResponse UpdateDeviceStatus(UpdateDeviceStatusRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateDeviceStatusRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateDeviceStatusResponseUnmarshaller.Instance;
return Invoke<UpdateDeviceStatusResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateDeviceStatus operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateDeviceStatus operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateDeviceStatus
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateDeviceStatus">REST API Reference for UpdateDeviceStatus Operation</seealso>
public virtual IAsyncResult BeginUpdateDeviceStatus(UpdateDeviceStatusRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateDeviceStatusRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateDeviceStatusResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateDeviceStatus operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateDeviceStatus.</param>
///
/// <returns>Returns a UpdateDeviceStatusResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateDeviceStatus">REST API Reference for UpdateDeviceStatus Operation</seealso>
public virtual UpdateDeviceStatusResponse EndUpdateDeviceStatus(IAsyncResult asyncResult)
{
return EndInvoke<UpdateDeviceStatusResponse>(asyncResult);
}
#endregion
#region UpdateGroup
/// <summary>
/// Updates the specified group with the specified attributes.
///
///
/// <para>
/// Calling this action requires developer credentials.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateGroup service method.</param>
///
/// <returns>The response from the UpdateGroup service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateGroup">REST API Reference for UpdateGroup Operation</seealso>
public virtual UpdateGroupResponse UpdateGroup(UpdateGroupRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateGroupResponseUnmarshaller.Instance;
return Invoke<UpdateGroupResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateGroup operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateGroup operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateGroup
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateGroup">REST API Reference for UpdateGroup Operation</seealso>
public virtual IAsyncResult BeginUpdateGroup(UpdateGroupRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateGroupRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateGroupResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateGroup operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateGroup.</param>
///
/// <returns>Returns a UpdateGroupResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateGroup">REST API Reference for UpdateGroup Operation</seealso>
public virtual UpdateGroupResponse EndUpdateGroup(IAsyncResult asyncResult)
{
return EndInvoke<UpdateGroupResponse>(asyncResult);
}
#endregion
#region UpdateIdentityProvider
/// <summary>
/// Updates identity provider information for a user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateIdentityProvider service method.</param>
///
/// <returns>The response from the UpdateIdentityProvider service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnsupportedIdentityProviderException">
/// This exception is thrown when the specified identifier is not supported.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateIdentityProvider">REST API Reference for UpdateIdentityProvider Operation</seealso>
public virtual UpdateIdentityProviderResponse UpdateIdentityProvider(UpdateIdentityProviderRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateIdentityProviderResponseUnmarshaller.Instance;
return Invoke<UpdateIdentityProviderResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateIdentityProvider operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateIdentityProvider operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateIdentityProvider
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateIdentityProvider">REST API Reference for UpdateIdentityProvider Operation</seealso>
public virtual IAsyncResult BeginUpdateIdentityProvider(UpdateIdentityProviderRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateIdentityProviderRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateIdentityProviderResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateIdentityProvider operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateIdentityProvider.</param>
///
/// <returns>Returns a UpdateIdentityProviderResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateIdentityProvider">REST API Reference for UpdateIdentityProvider Operation</seealso>
public virtual UpdateIdentityProviderResponse EndUpdateIdentityProvider(IAsyncResult asyncResult)
{
return EndInvoke<UpdateIdentityProviderResponse>(asyncResult);
}
#endregion
#region UpdateResourceServer
/// <summary>
/// Updates the name and scopes of resource server. All other fields are read-only.
///
/// <important>
/// <para>
/// If you don't provide a value for an attribute, it will be set to the default value.
/// </para>
/// </important>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateResourceServer service method.</param>
///
/// <returns>The response from the UpdateResourceServer service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateResourceServer">REST API Reference for UpdateResourceServer Operation</seealso>
public virtual UpdateResourceServerResponse UpdateResourceServer(UpdateResourceServerRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateResourceServerResponseUnmarshaller.Instance;
return Invoke<UpdateResourceServerResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateResourceServer operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateResourceServer operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateResourceServer
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateResourceServer">REST API Reference for UpdateResourceServer Operation</seealso>
public virtual IAsyncResult BeginUpdateResourceServer(UpdateResourceServerRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateResourceServerRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateResourceServerResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateResourceServer operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateResourceServer.</param>
///
/// <returns>Returns a UpdateResourceServerResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateResourceServer">REST API Reference for UpdateResourceServer Operation</seealso>
public virtual UpdateResourceServerResponse EndUpdateResourceServer(IAsyncResult asyncResult)
{
return EndInvoke<UpdateResourceServerResponse>(asyncResult);
}
#endregion
#region UpdateUserAttributes
/// <summary>
/// Allows a user to update a specific attribute (one at a time).
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateUserAttributes service method.</param>
///
/// <returns>The response from the UpdateUserAttributes service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.AliasExistsException">
/// This exception is thrown when a user tries to confirm the account with an email or
/// phone number that has already been supplied as an alias from a different account.
/// This exception tells user that an account with this email or phone already exists.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeDeliveryFailureException">
/// This exception is thrown when a verification code fails to deliver successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidLambdaResponseException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid Lambda
/// response.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UnexpectedLambdaException">
/// This exception is thrown when the Amazon Cognito service encounters an unexpected
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserLambdaValidationException">
/// This exception is thrown when the Amazon Cognito service encounters a user validation
/// exception with the Lambda service.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserAttributes">REST API Reference for UpdateUserAttributes Operation</seealso>
public virtual UpdateUserAttributesResponse UpdateUserAttributes(UpdateUserAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserAttributesResponseUnmarshaller.Instance;
return Invoke<UpdateUserAttributesResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateUserAttributes operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateUserAttributes operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserAttributes
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserAttributes">REST API Reference for UpdateUserAttributes Operation</seealso>
public virtual IAsyncResult BeginUpdateUserAttributes(UpdateUserAttributesRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserAttributesResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateUserAttributes operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateUserAttributes.</param>
///
/// <returns>Returns a UpdateUserAttributesResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserAttributes">REST API Reference for UpdateUserAttributes Operation</seealso>
public virtual UpdateUserAttributesResponse EndUpdateUserAttributes(IAsyncResult asyncResult)
{
return EndInvoke<UpdateUserAttributesResponse>(asyncResult);
}
#endregion
#region UpdateUserPool
/// <summary>
/// Updates the specified user pool with the specified attributes. You can get a list
/// of the current user pool settings using <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DescribeUserPool.html">DescribeUserPool</a>.
/// If you don't provide a value for an attribute, it will be set to the default value.
///
/// <note>
/// <para>
/// This action might generate an SMS text message. Starting June 1, 2021, U.S. telecom
/// carriers require that you register an origination phone number before you can send
/// SMS messages to U.S. phone numbers. If you use SMS text messages in Amazon Cognito,
/// you must register a phone number with <a href="https://console.aws.amazon.com/pinpoint/home/">Amazon
/// Pinpoint</a>. Cognito will use the the registered number automatically. Otherwise,
/// Cognito users that must receive SMS messages might be unable to sign up, activate
/// their accounts, or sign in.
/// </para>
///
/// <para>
/// If you have never used SMS text messages with Amazon Cognito or any other Amazon Web
/// Service, Amazon SNS might place your account in SMS sandbox. In <i> <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html">sandbox
/// mode</a> </i>, you’ll have limitations, such as sending messages to only verified
/// phone numbers. After testing in the sandbox environment, you can move out of the SMS
/// sandbox and into production. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html">
/// SMS message settings for Cognito User Pools</a> in the <i>Amazon Cognito Developer
/// Guide</i>.
/// </para>
/// </note>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPool service method.</param>
///
/// <returns>The response from the UpdateUserPool service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ConcurrentModificationException">
/// This exception is thrown if two or more modifications are happening concurrently.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidEmailRoleAccessPolicyException">
/// This exception is thrown when Amazon Cognito is not allowed to use your email identity.
/// HTTP status code: 400.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleAccessPolicyException">
/// This exception is returned when the role provided for SMS configuration does not have
/// permission to publish using Amazon SNS.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidSmsRoleTrustRelationshipException">
/// This exception is thrown when the trust relationship is invalid for the role provided
/// for SMS configuration. This can happen if you do not trust <code>cognito-idp.amazonaws.com</code>
/// or the external ID provided in the role does not match what is provided in the SMS
/// configuration for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserImportInProgressException">
/// This exception is thrown when you are trying to modify a user pool while a user import
/// job is in progress for that pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserPoolTaggingException">
/// This exception is thrown when a user pool tag cannot be set or updated.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPool">REST API Reference for UpdateUserPool Operation</seealso>
public virtual UpdateUserPoolResponse UpdateUserPool(UpdateUserPoolRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolResponseUnmarshaller.Instance;
return Invoke<UpdateUserPoolResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateUserPool operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPool operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserPool
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPool">REST API Reference for UpdateUserPool Operation</seealso>
public virtual IAsyncResult BeginUpdateUserPool(UpdateUserPoolRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateUserPool operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateUserPool.</param>
///
/// <returns>Returns a UpdateUserPoolResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPool">REST API Reference for UpdateUserPool Operation</seealso>
public virtual UpdateUserPoolResponse EndUpdateUserPool(IAsyncResult asyncResult)
{
return EndInvoke<UpdateUserPoolResponse>(asyncResult);
}
#endregion
#region UpdateUserPoolClient
/// <summary>
/// Updates the specified user pool app client with the specified attributes. You can
/// get a list of the current user pool app client settings using <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_DescribeUserPoolClient.html">DescribeUserPoolClient</a>.
///
/// <important>
/// <para>
/// If you don't provide a value for an attribute, it will be set to the default value.
/// </para>
/// </important>
/// <para>
/// You can also use this operation to enable token revocation for user pool clients.
/// For more information about revoking tokens, see <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_RevokeToken.html">RevokeToken</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolClient service method.</param>
///
/// <returns>The response from the UpdateUserPoolClient service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ConcurrentModificationException">
/// This exception is thrown if two or more modifications are happening concurrently.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidOAuthFlowException">
/// This exception is thrown when the specified OAuth flow is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ScopeDoesNotExistException">
/// This exception is thrown when the specified scope does not exist.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolClient">REST API Reference for UpdateUserPoolClient Operation</seealso>
public virtual UpdateUserPoolClientResponse UpdateUserPoolClient(UpdateUserPoolClientRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolClientResponseUnmarshaller.Instance;
return Invoke<UpdateUserPoolClientResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateUserPoolClient operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolClient operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserPoolClient
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolClient">REST API Reference for UpdateUserPoolClient Operation</seealso>
public virtual IAsyncResult BeginUpdateUserPoolClient(UpdateUserPoolClientRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolClientRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolClientResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateUserPoolClient operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateUserPoolClient.</param>
///
/// <returns>Returns a UpdateUserPoolClientResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolClient">REST API Reference for UpdateUserPoolClient Operation</seealso>
public virtual UpdateUserPoolClientResponse EndUpdateUserPoolClient(IAsyncResult asyncResult)
{
return EndInvoke<UpdateUserPoolClientResponse>(asyncResult);
}
#endregion
#region UpdateUserPoolDomain
/// <summary>
/// Updates the Secure Sockets Layer (SSL) certificate for the custom domain for your
/// user pool.
///
///
/// <para>
/// You can use this operation to provide the Amazon Resource Name (ARN) of a new certificate
/// to Amazon Cognito. You cannot use it to change the domain for a user pool.
/// </para>
///
/// <para>
/// A custom domain is used to host the Amazon Cognito hosted UI, which provides sign-up
/// and sign-in pages for your application. When you set up a custom domain, you provide
/// a certificate that you manage with Certificate Manager (ACM). When necessary, you
/// can use this operation to change the certificate that you applied to your custom domain.
/// </para>
///
/// <para>
/// Usually, this is unnecessary following routine certificate renewal with ACM. When
/// you renew your existing certificate in ACM, the ARN for your certificate remains the
/// same, and your custom domain uses the new certificate automatically.
/// </para>
///
/// <para>
/// However, if you replace your existing certificate with a new one, ACM gives the new
/// certificate a new ARN. To apply the new certificate to your custom domain, you must
/// provide this ARN to Amazon Cognito.
/// </para>
///
/// <para>
/// When you add your new certificate in ACM, you must choose US East (N. Virginia) as
/// the Region.
/// </para>
///
/// <para>
/// After you submit your request, Amazon Cognito requires up to 1 hour to distribute
/// your new certificate to your custom domain.
/// </para>
///
/// <para>
/// For more information about adding a custom domain to your user pool, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html">Using
/// Your Own Domain for the Hosted UI</a>.
/// </para>
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolDomain service method.</param>
///
/// <returns>The response from the UpdateUserPoolDomain service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolDomain">REST API Reference for UpdateUserPoolDomain Operation</seealso>
public virtual UpdateUserPoolDomainResponse UpdateUserPoolDomain(UpdateUserPoolDomainRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolDomainResponseUnmarshaller.Instance;
return Invoke<UpdateUserPoolDomainResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the UpdateUserPoolDomain operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the UpdateUserPoolDomain operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateUserPoolDomain
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolDomain">REST API Reference for UpdateUserPoolDomain Operation</seealso>
public virtual IAsyncResult BeginUpdateUserPoolDomain(UpdateUserPoolDomainRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateUserPoolDomainRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateUserPoolDomainResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the UpdateUserPoolDomain operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginUpdateUserPoolDomain.</param>
///
/// <returns>Returns a UpdateUserPoolDomainResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolDomain">REST API Reference for UpdateUserPoolDomain Operation</seealso>
public virtual UpdateUserPoolDomainResponse EndUpdateUserPoolDomain(IAsyncResult asyncResult)
{
return EndInvoke<UpdateUserPoolDomainResponse>(asyncResult);
}
#endregion
#region VerifySoftwareToken
/// <summary>
/// Use this API to register a user's entered TOTP code and mark the user's software token
/// MFA status as "verified" if successful. The request takes an access token or a session
/// string, but not both.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the VerifySoftwareToken service method.</param>
///
/// <returns>The response from the VerifySoftwareToken service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.EnableSoftwareTokenMFAException">
/// This exception is thrown when there is a code mismatch and the service fails to configure
/// the software token TOTP multi-factor authentication (MFA).
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidUserPoolConfigurationException">
/// This exception is thrown when the user pool configuration is invalid.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.SoftwareTokenMFANotFoundException">
/// This exception is thrown when the software token TOTP multi-factor authentication
/// (MFA) is not enabled for the user pool.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifySoftwareToken">REST API Reference for VerifySoftwareToken Operation</seealso>
public virtual VerifySoftwareTokenResponse VerifySoftwareToken(VerifySoftwareTokenRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = VerifySoftwareTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = VerifySoftwareTokenResponseUnmarshaller.Instance;
return Invoke<VerifySoftwareTokenResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the VerifySoftwareToken operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the VerifySoftwareToken operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndVerifySoftwareToken
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifySoftwareToken">REST API Reference for VerifySoftwareToken Operation</seealso>
public virtual IAsyncResult BeginVerifySoftwareToken(VerifySoftwareTokenRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = VerifySoftwareTokenRequestMarshaller.Instance;
options.ResponseUnmarshaller = VerifySoftwareTokenResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the VerifySoftwareToken operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginVerifySoftwareToken.</param>
///
/// <returns>Returns a VerifySoftwareTokenResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifySoftwareToken">REST API Reference for VerifySoftwareToken Operation</seealso>
public virtual VerifySoftwareTokenResponse EndVerifySoftwareToken(IAsyncResult asyncResult)
{
return EndInvoke<VerifySoftwareTokenResponse>(asyncResult);
}
#endregion
#region VerifyUserAttribute
/// <summary>
/// Verifies the specified user attributes in the user pool.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the VerifyUserAttribute service method.</param>
///
/// <returns>The response from the VerifyUserAttribute service method, as returned by CognitoIdentityProvider.</returns>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.CodeMismatchException">
/// This exception is thrown if the provided code does not match what the server was expecting.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ExpiredCodeException">
/// This exception is thrown if a code has expired.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InternalErrorException">
/// This exception is thrown when Amazon Cognito encounters an internal error.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.InvalidParameterException">
/// This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.LimitExceededException">
/// This exception is thrown when a user exceeds the limit for a requested Amazon Web
/// Services resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.NotAuthorizedException">
/// This exception is thrown when a user is not authorized.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.PasswordResetRequiredException">
/// This exception is thrown when a password reset is required.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.ResourceNotFoundException">
/// This exception is thrown when the Amazon Cognito service cannot find the requested
/// resource.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.TooManyRequestsException">
/// This exception is thrown when the user has made too many requests for a given operation.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotConfirmedException">
/// This exception is thrown when a user is not confirmed successfully.
/// </exception>
/// <exception cref="Amazon.CognitoIdentityProvider.Model.UserNotFoundException">
/// This exception is thrown when a user is not found.
/// </exception>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifyUserAttribute">REST API Reference for VerifyUserAttribute Operation</seealso>
public virtual VerifyUserAttributeResponse VerifyUserAttribute(VerifyUserAttributeRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = VerifyUserAttributeRequestMarshaller.Instance;
options.ResponseUnmarshaller = VerifyUserAttributeResponseUnmarshaller.Instance;
return Invoke<VerifyUserAttributeResponse>(request, options);
}
/// <summary>
/// Initiates the asynchronous execution of the VerifyUserAttribute operation.
/// </summary>
///
/// <param name="request">Container for the necessary parameters to execute the VerifyUserAttribute operation on AmazonCognitoIdentityProviderClient.</param>
/// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
/// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
/// procedure using the AsyncState property.</param>
///
/// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndVerifyUserAttribute
/// operation.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifyUserAttribute">REST API Reference for VerifyUserAttribute Operation</seealso>
public virtual IAsyncResult BeginVerifyUserAttribute(VerifyUserAttributeRequest request, AsyncCallback callback, object state)
{
var options = new InvokeOptions();
options.RequestMarshaller = VerifyUserAttributeRequestMarshaller.Instance;
options.ResponseUnmarshaller = VerifyUserAttributeResponseUnmarshaller.Instance;
return BeginInvoke(request, options, callback, state);
}
/// <summary>
/// Finishes the asynchronous execution of the VerifyUserAttribute operation.
/// </summary>
///
/// <param name="asyncResult">The IAsyncResult returned by the call to BeginVerifyUserAttribute.</param>
///
/// <returns>Returns a VerifyUserAttributeResult from CognitoIdentityProvider.</returns>
/// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifyUserAttribute">REST API Reference for VerifyUserAttribute Operation</seealso>
public virtual VerifyUserAttributeResponse EndVerifyUserAttribute(IAsyncResult asyncResult)
{
return EndInvoke<VerifyUserAttributeResponse>(asyncResult);
}
#endregion
}
} | 61.324223 | 228 | 0.685875 | [
"Apache-2.0"
] | EbstaLimited/aws-sdk-net | sdk/src/Services/CognitoIdentityProvider/Generated/_bcl35/AmazonCognitoIdentityProviderClient.cs | 556,490 | C# |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Web;
using Wutnu.Data;
namespace Wutnu.Common.ErrorMgr
{
public class ErrorMgr: IErrorMgr
{
private readonly IErrorMgr _mgr;
public ErrorMgr(WutNuContext entities, HttpContextBase ctx)
{
_mgr = new ErrorMgrDb(entities, ctx);
/*
switch (destination)
{
case ErrorDest.Sql:
_mgr = new ErrorMgrDb(entities, ctx);
break;
}
*/
}
public IEnumerable<ErrItemPoco> GetErrorItems(int count=100)
{
return _mgr.GetErrorItems(count);
}
public ErrItemPoco ReadError(string id)
{
return _mgr.ReadError(id);
}
public bool SaveError(ErrItemPoco eo)
{
return _mgr.SaveError(eo);
}
public ErrResponsePoco InsertError(Exception err, string message = "", string userComment="")
{
return _mgr.InsertError(err, message, userComment);
}
/// <summary>
/// Writes an error entry to the Application log, Application Source. This is a fallback error writing mechanism.
/// </summary>
/// <param name="message">The error message.</param>
/// <param name="errorType">Type of error.</param>
public void WriteToAppLog(string message, EventLogEntryType errorType)
{
Logging.WriteToAppLog(message, errorType);
}
public void Dispose()
{
_mgr.Dispose();
}
}
public class ErrItemPoco
{
public string BlobId { get; set; }
public int Id { get; set; }
public DateTime ErrorDate { get; set; }
public string Status { get; set; }
public string ErrorSource { get; set; }
public string ErrorMessage { get; set; }
public string StackTrace { get; set; }
public string InnerException { get; set; }
public string Message { get; set; }
public string UserAgent { get; set; }
public string IPAddress { get; set; }
public string UserId { get; set; }
public string URI { get; set; }
public string SiteURL { get; set; }
public string Referrer { get; set; }
public string PostData { get; set; }
public string QSData { get; set; }
public string UserComment { get; set; }
}
public class ErrResponsePoco
{
public string DbErrorId { get; set; }
public string ErrorTitle { get; set; }
public string ErrorMessage { get; set; }
}
public enum ErrorDest
{
Sql
}
}
| 30.344444 | 121 | 0.566093 | [
"Apache-2.0"
] | Matty9191/Wutnu | Wutnu.Common/ErrorMgr/ErrorMgr.cs | 2,733 | C# |
// <auto-generated/>
#pragma warning disable 1591
namespace Test
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase
{
#pragma warning disable 1998
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder)
{
__builder.OpenElement(0, "input");
__builder.AddAttribute(1, "type", "text");
__builder.AddAttribute(2, "@bind",
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
CurrentDate
#line default
#line hidden
#nullable disable
);
__builder.AddAttribute(3, "@bind:format",
#nullable restore
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml"
Format
#line default
#line hidden
#nullable disable
);
__builder.CloseElement();
}
#pragma warning restore 1998
#nullable restore
#line 2 "x:\dir\subdir\Test\TestComponent.cshtml"
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
public string Format { get; set; } = "MM/dd/yyyy";
#line default
#line hidden
#nullable disable
}
}
#pragma warning restore 1591
| 27.942308 | 126 | 0.640055 | [
"MIT"
] | dotnet/razor-compiler | src/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BuiltIn_BindToInputText_WithFormatFromProperty_WritesAttributes/TestComponent.codegen.cs | 1,453 | C# |
namespace OctanGames.SaveModule.Serialization
{
public interface ISerializationSystem
{
bool SerializeObject<T>(T obj);
T DeserializeObject<T>();
}
}
| 17.555556 | 46 | 0.759494 | [
"MIT"
] | TheOctan/save-system | Runtime/Serialization/ISerializationSystem.cs | 160 | C# |
// Copyright (c) 2011, Eric Maupin
// 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 Gablarski nor the names of its
// contributors may be used to endorse or promote products
// or services 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;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Gablarski.Audio;
using Gablarski.Messages;
namespace Gablarski.Client
{
public class ClientSourceManager
: AudioSourceManager, IClientSourceManager
{
protected internal ClientSourceManager (IGablarskiClientContext context)
{
if (context == null)
throw new ArgumentNullException ("context");
this.context = context;
}
public object SyncRoot
{
get { return this.syncRoot; }
}
/// <summary>
/// Gets a listing of the sources that belong to the current user.
/// </summary>
public IEnumerable<AudioSource> Mine
{
get
{
lock (syncRoot)
{
return this.Where (s => s.OwnerId == context.CurrentUser.UserId).ToList();
}
}
}
public void Add (AudioSource source)
{
Update (source);
}
public void Update (IEnumerable<AudioSource> updatedSources)
{
if (updatedSources == null)
throw new ArgumentNullException ("updatedSources");
IEnumerable<AudioSource> updatedAndNew;
lock (syncRoot)
{
updatedAndNew = updatedSources.Where (s => !Sources.ContainsValue (s));
updatedAndNew = updatedAndNew.Concat (Sources.Values.Intersect (updatedSources)).ToList();
var deleted = Sources.Values.Where (s => !updatedSources.Contains (s)).ToList();
foreach (var s in updatedAndNew)
Update (s);
foreach (var d in deleted)
{
lock (Sources)
Sources.Remove (d.Id);
}
}
}
public void Update (AudioSource source)
{
if (source == null)
throw new ArgumentNullException ("source");
lock (syncRoot)
{
AudioSource oldSource;
if (!Sources.TryGetValue (source.Id, out oldSource))
{
Sources[source.Id] = source;
OwnedSources.Add (source.OwnerId, source);
}
else
source.CopyTo (oldSource);
}
}
public bool GetIsIgnored (AudioSource source)
{
if (source == null)
throw new ArgumentNullException ("source");
lock (syncRoot)
{
return ignoredSources.Contains (source);
}
}
public bool ToggleIgnore (AudioSource source)
{
if (source == null)
throw new ArgumentNullException ("source");
lock (syncRoot)
{
if (!Sources.ContainsKey (source.Id))
return false;
bool ignored = ignoredSources.Contains (source);
if (ignored)
ignoredSources.Remove (source);
else
ignoredSources.Add (source);
return !ignored;
}
}
public override void Clear()
{
lock (syncRoot)
{
ignoredSources.Clear();
base.Clear();
}
}
private readonly IGablarskiClientContext context;
private readonly HashSet<AudioSource> ignoredSources = new HashSet<AudioSource>();
}
#region Event Args
public class AudioSourceMutedEventArgs
: AudioSourceEventArgs
{
public AudioSourceMutedEventArgs (AudioSource source, bool unmuted)
: base (source)
{
this.Unmuted = unmuted;
}
public bool Unmuted { get; set; }
}
public class ReceivedAudioSourceEventArgs
: EventArgs
{
public ReceivedAudioSourceEventArgs (string sourceName, AudioSource source, SourceResult result)
{
this.SourceName = sourceName;
this.Result = result;
this.Source = source;
}
/// <summary>
/// Gets the name of the requested source.
/// </summary>
public string SourceName
{
get;
private set;
}
/// <summary>
/// Gets the result of the source request.
/// </summary>
public SourceResult Result
{
get;
private set;
}
/// <summary>
/// Gets the media source of the event. <c>null</c> if failed.
/// </summary>
public AudioSource Source
{
get;
private set;
}
}
#endregion
} | 24.855856 | 99 | 0.665458 | [
"BSD-3-Clause"
] | ermau/Gablarski | src/Gablarski/Client/ClientSourceManager.cs | 5,518 | C# |
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;
namespace Korduene.UI.WPF.Converters
{
public class FileTypeToImageConverter : MarkupExtension, IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var item = value as WorkspaceItem;
if (item == null)
{
return null;
}
if (item.Type == WorkspaceItemType.Folder)
{
return GetResource("Folder_16x");
}
else if (item.Type == WorkspaceItemType.Solution || item.Type == WorkspaceItemType.Project || item.Type == WorkspaceItemType.File)
{
var extension = System.IO.Path.GetExtension(item.Path).ToLower();
switch (extension)
{
case ".sln":
return GetResource("Application_16x");
case ".csproj":
return GetResource("CSApplication_16x");
case ".xaml":
return GetResource("WPFPage_16x");
case ".cs":
return GetResource("CS_16x");
default:
return GetResource("TextFile_16x");
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this;
}
private object GetResource(string name)
{
foreach (var md in System.Windows.Application.Current.Resources.MergedDictionaries)
{
foreach (var key in md.Keys)
{
if (key.ToString().Equals(name))
{
return md[key];
}
}
}
return null;
}
}
}
| 30.138889 | 142 | 0.496774 | [
"MIT"
] | Flippo24/Korduene | Korduene.UI.WPF/Converters/FileTypeToImageConverter.cs | 2,172 | C# |
using JsTypes;
namespace Router.TpLink;
public static class IRouterHttpMessageSenderExtensions
{
public static Task SendMessageAsync(this IRouterHttpMessageSender sender, string path, IEnumerable<KeyValuePair<string, string>>? query = null, HttpMethod? method = null) =>
sender.SendMessageAsync(new RouterHttpMessage(path, query, method));
public static Task<List<JsVariable>> SendMessageAndParseAsync(this IRouterHttpMessageSender sender, string path, IEnumerable<KeyValuePair<string, string>>? query = null, HttpMethod? method = null) =>
sender.SendMessageAndParseAsync(new RouterHttpMessage(path, query, method));
} | 50 | 203 | 0.781538 | [
"MIT"
] | ashenBlade/tpcon | src/Router.TpLink/IRouterHttpMessageSenderExtensions.cs | 650 | C# |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated code. DO NOT EDIT!
namespace Google.Cloud.Tasks.V2.Snippets
{
using Google.Cloud.Tasks.V2;
public sealed partial class GeneratedCloudTasksClientStandaloneSnippets
{
/// <summary>Snippet for RunTask</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public void RunTaskRequestObject()
{
// Create client
CloudTasksClient cloudTasksClient = CloudTasksClient.Create();
// Initialize request argument(s)
RunTaskRequest request = new RunTaskRequest
{
TaskName = TaskName.FromProjectLocationQueueTask("[PROJECT]", "[LOCATION]", "[QUEUE]", "[TASK]"),
ResponseView = Task.Types.View.Unspecified,
};
// Make the request
Task response = cloudTasksClient.RunTask(request);
}
}
}
| 37.488372 | 113 | 0.66129 | [
"Apache-2.0"
] | googleapis/googleapis-gen | google/cloud/tasks/v2/google-cloud-tasks-v2-csharp/Google.Cloud.Tasks.V2.StandaloneSnippets/CloudTasksClient.RunTaskRequestObjectSnippet.g.cs | 1,612 | C# |
namespace NotepadSharp
{
partial class PanelEx
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
this.ResumeLayout(false);
}
#endregion
}
}
| 22.153846 | 71 | 0.488426 | [
"MIT"
] | XHSofts/NotepadSharp | PanelEx.Designer.cs | 1,020 | C# |
using System;
using System.Collections.Generic;
namespace AbstractFactory.Contracts.Hotels
{
public interface ICustomer
{
Guid Id { get; }
string FullName { get; }
bool IsChild { get; }
string PaymentCard { get; }
ICollection<IBooking> GetBookings();
void AddBooking(IBooking booking);
IBooking GetAvailableBooking();
}
}
| 23.058824 | 44 | 0.635204 | [
"Apache-2.0"
] | ali515/desing-patterns | 01-Creator/03-AbstractFactory/AbstractFactory/Contracts/Hotels/ICustomer.cs | 394 | C# |
namespace pearblossom
{
partial class Form2
{
/// <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.webBrowser1 = new System.Windows.Forms.WebBrowser();
this.SuspendLayout();
//
// webBrowser1
//
this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
this.webBrowser1.Location = new System.Drawing.Point(0, 0);
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.Size = new System.Drawing.Size(782, 555);
this.webBrowser1.TabIndex = 0;
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(782, 555);
this.Controls.Add(this.webBrowser1);
this.MinimumSize = new System.Drawing.Size(800, 600);
this.Name = "Form2";
this.Text = "关于";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.WebBrowser webBrowser1;
}
} | 34.166667 | 107 | 0.559024 | [
"Apache-2.0"
] | angela-1/pearblossom | pearblossom/forms/AboutForm.Designer.cs | 2,056 | C# |
using GroceryImport.Core.DataRecords.ProductRecords;
namespace GroceryImport.Core.DataRecords.TraderFoods.FourZeroFour.OutputFields
{
internal sealed class TraderFoods404RegularCalculatorPrice : CalculatorPrice
{
private readonly ITraderFoods404InputRecord _inputRecord;
public TraderFoods404RegularCalculatorPrice(ITraderFoods404InputRecord inputRecord) => _inputRecord = inputRecord;
public override decimal AsSystemType()
{
if (_inputRecord.IsRegularSplitPrice()) return new TraderFoods404CalculatorSplitPrice(_inputRecord.RegularSplitPrice(), _inputRecord.RegularForQuantity());
return new TraderFoods404CalculatorSingularPrice(_inputRecord.RegularSingularPrice());
}
}
} | 41.944444 | 167 | 0.781457 | [
"MIT"
] | Fyzxs/code-exercise-services | GroceryImport/GroceryImport.Core/DataRecords/TraderFoods/FourZeroFour/OutputFields/TraderFoods404RegularCalculatorPrice.cs | 755 | C# |
using System;
using System.IO;
using UnityEngine;
using Flunity.Utils;
using Flunity;
namespace Flunity.Internal
{
internal static class ResourceHelper
{
public static string rootPath = ".";
public static String GetDocPath(string localPath)
{
localPath = NormalizeSeparator(localPath);
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), localPath);
}
public static String NormalizeSeparator(string path)
{
return path.Replace('/', Path.DirectorySeparatorChar)
.Replace('\\', Path.DirectorySeparatorChar);
}
public static string ReadText(string fullPath)
{
var result = TryReadText(fullPath);
if (result == null)
throw new Exception("Resource not found: " + fullPath);
return result;
}
public static string TryReadText(string fullPath)
{
#if (UNITY_EDITOR || UNITY_STANDALONE) && !UNITY_WEBPLAYER
if (FlashResources.isPlatformReloadingEnabled)
{
if (!fullPath.EndsWith(".txt", StringComparison.Ordinal))
fullPath = fullPath + ".txt";
var globalPath = Path.GetFullPath(PathUtil.Combine("Assets", "Resources", fullPath));
return File.Exists(globalPath)
? File.ReadAllText(globalPath)
: null;
}
else
#endif
{
if (fullPath.EndsWith(".txt", StringComparison.Ordinal))
fullPath = fullPath.Substring(0, fullPath.Length - 4);
var asset = UnityEngine.Resources.Load<TextAsset>(fullPath);
return (asset != null) ? asset.text : null;
}
}
public static byte[] ReadBytes(string fullPath)
{
using (var fileStream = GetReadStream(fullPath))
{
using (var memoryStream = new MemoryStream())
{
fileStream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
}
public static FileStream GetWriteStream(string fullPath)
{
return File.Open(fullPath, FileMode.Create);
}
public static Stream GetReadStream(string fullPath)
{
#if ANDROID
return Game.Activity.Assets.Open(fullPath);
#else
return File.Open(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read);
#endif
}
public static bool AssetExists(string fullPath)
{
return File.Exists("Assets/Resources/" + fullPath);
}
}
} | 24.533333 | 100 | 0.701087 | [
"MIT"
] | canab/flunity | SampleProject/Assets/Flunity/Internal/ResourceHelper.cs | 2,208 | C# |
namespace SharedTrip.ViewModels.Users
{
public class RegisterUserFormModel
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
}
}
| 25.272727 | 51 | 0.625899 | [
"MIT"
] | GeorgiPopovIT/CSharp-Web | Exams/MyExam/01. Shared Trip_Skeleton - New Framework/SharedTrip/ViewModels/Users/RegisterUserFormModel.cs | 280 | C# |
// *****************************************************************************
// BSD 3-Clause License (https://github.com/ComponentFactory/Krypton/blob/master/LICENSE)
// © Component Factory Pty Ltd, 2006 - 2016, All rights reserved.
// The software and associated documentation supplied hereunder are the
// proprietary information of Component Factory Pty Ltd, 13 Swallows Close,
// Mornington, Vic 3931, Australia and are supplied subject to license terms.
//
// Modifications by Peter Wagner(aka Wagnerp) & Simon Coghlan(aka Smurf-IV) 2017 - 2020. All rights reserved. (https://github.com/Wagnerp/Krypton-NET-5.480)
// Version 5.480.0.0 www.ComponentFactory.com
// *****************************************************************************
namespace ComponentFactory.Krypton.Navigator
{
/// <summary>
/// Details for a direction button (next/previous) action event.
/// </summary>
public class DirectionActionEventArgs : KryptonPageEventArgs
{
#region Instance Fields
#endregion
#region Identity
/// <summary>
/// Initialize a new instance of the DirectionActionEventArgs class.
/// </summary>
/// <param name="page">Page effected by event.</param>
/// <param name="index">Index of page in the owning collection.</param>
/// <param name="action">Previous/Next action to take.</param>
public DirectionActionEventArgs(KryptonPage page,
int index,
DirectionButtonAction action)
: base(page, index)
{
Action = action;
}
#endregion
#region Action
/// <summary>
/// Gets and sets the next/previous action to take.
/// </summary>
public DirectionButtonAction Action { get; set; }
#endregion
}
}
| 39.458333 | 157 | 0.571806 | [
"BSD-3-Clause"
] | Krypton-Suite-Legacy/Krypton-NET-5.480 | Source/Krypton Components/ComponentFactory.Krypton.Navigator/EventArgs/DirectionActionEventArgs.cs | 1,897 | 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.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Xml.Schema;
namespace System.Xml
{
internal class XmlAsyncCheckReader : XmlReader
{
private readonly XmlReader _coreReader = null;
private Task _lastTask = Task.CompletedTask;
internal XmlReader CoreReader
{
get
{
return _coreReader;
}
}
public static XmlAsyncCheckReader CreateAsyncCheckWrapper(XmlReader reader)
{
if (reader is IXmlLineInfo)
{
if (reader is IXmlNamespaceResolver)
{
return new XmlAsyncCheckReaderWithLineInfoNS(reader);
}
return new XmlAsyncCheckReaderWithLineInfo(reader);
}
else if (reader is IXmlNamespaceResolver)
{
return new XmlAsyncCheckReaderWithNS(reader);
}
return new XmlAsyncCheckReader(reader);
}
public XmlAsyncCheckReader(XmlReader reader)
{
_coreReader = reader;
}
private void CheckAsync()
{
if (!_lastTask.IsCompleted)
{
throw new InvalidOperationException(SR.Xml_AsyncIsRunningException);
}
}
#region Sync Methods, Properties Check
public override XmlReaderSettings Settings
{
get
{
XmlReaderSettings settings = _coreReader.Settings;
if (null != settings)
{
settings = settings.Clone();
}
else
{
settings = new XmlReaderSettings();
}
settings.Async = true;
settings.ReadOnly = true;
return settings;
}
}
public override XmlNodeType NodeType
{
get
{
CheckAsync();
return _coreReader.NodeType;
}
}
public override string Name
{
get
{
CheckAsync();
return _coreReader.Name;
}
}
public override string LocalName
{
get
{
CheckAsync();
return _coreReader.LocalName;
}
}
public override string NamespaceURI
{
get
{
CheckAsync();
return _coreReader.NamespaceURI;
}
}
public override string Prefix
{
get
{
CheckAsync();
return _coreReader.Prefix;
}
}
public override bool HasValue
{
get
{
CheckAsync();
return _coreReader.HasValue;
}
}
public override string Value
{
get
{
CheckAsync();
return _coreReader.Value;
}
}
public override int Depth
{
get
{
CheckAsync();
return _coreReader.Depth;
}
}
public override string BaseURI
{
get
{
CheckAsync();
return _coreReader.BaseURI;
}
}
public override bool IsEmptyElement
{
get
{
CheckAsync();
return _coreReader.IsEmptyElement;
}
}
public override bool IsDefault
{
get
{
CheckAsync();
return _coreReader.IsDefault;
}
}
public override XmlSpace XmlSpace
{
get
{
CheckAsync();
return _coreReader.XmlSpace;
}
}
public override string XmlLang
{
get
{
CheckAsync();
return _coreReader.XmlLang;
}
}
public override System.Type ValueType
{
get
{
CheckAsync();
return _coreReader.ValueType;
}
}
public override object ReadContentAsObject()
{
CheckAsync();
return _coreReader.ReadContentAsObject();
}
public override bool ReadContentAsBoolean()
{
CheckAsync();
return _coreReader.ReadContentAsBoolean();
}
public override double ReadContentAsDouble()
{
CheckAsync();
return _coreReader.ReadContentAsDouble();
}
public override float ReadContentAsFloat()
{
CheckAsync();
return _coreReader.ReadContentAsFloat();
}
public override decimal ReadContentAsDecimal()
{
CheckAsync();
return _coreReader.ReadContentAsDecimal();
}
public override int ReadContentAsInt()
{
CheckAsync();
return _coreReader.ReadContentAsInt();
}
public override long ReadContentAsLong()
{
CheckAsync();
return _coreReader.ReadContentAsLong();
}
public override string ReadContentAsString()
{
CheckAsync();
return _coreReader.ReadContentAsString();
}
public override object ReadContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
{
CheckAsync();
return _coreReader.ReadContentAs(returnType, namespaceResolver);
}
public override object ReadElementContentAsObject()
{
CheckAsync();
return _coreReader.ReadElementContentAsObject();
}
public override object ReadElementContentAsObject(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsObject(localName, namespaceURI);
}
public override bool ReadElementContentAsBoolean()
{
CheckAsync();
return _coreReader.ReadElementContentAsBoolean();
}
public override bool ReadElementContentAsBoolean(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsBoolean(localName, namespaceURI);
}
public override DateTimeOffset ReadContentAsDateTimeOffset()
{
CheckAsync();
return _coreReader.ReadContentAsDateTimeOffset();
}
public override double ReadElementContentAsDouble()
{
CheckAsync();
return _coreReader.ReadElementContentAsDouble();
}
public override double ReadElementContentAsDouble(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsDouble(localName, namespaceURI);
}
public override float ReadElementContentAsFloat()
{
CheckAsync();
return _coreReader.ReadElementContentAsFloat();
}
public override float ReadElementContentAsFloat(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsFloat(localName, namespaceURI);
}
public override decimal ReadElementContentAsDecimal()
{
CheckAsync();
return _coreReader.ReadElementContentAsDecimal();
}
public override decimal ReadElementContentAsDecimal(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsDecimal(localName, namespaceURI);
}
public override int ReadElementContentAsInt()
{
CheckAsync();
return _coreReader.ReadElementContentAsInt();
}
public override int ReadElementContentAsInt(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsInt(localName, namespaceURI);
}
public override long ReadElementContentAsLong()
{
CheckAsync();
return _coreReader.ReadElementContentAsLong();
}
public override long ReadElementContentAsLong(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsLong(localName, namespaceURI);
}
public override string ReadElementContentAsString()
{
CheckAsync();
return _coreReader.ReadElementContentAsString();
}
public override string ReadElementContentAsString(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAsString(localName, namespaceURI);
}
public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver)
{
CheckAsync();
return _coreReader.ReadElementContentAs(returnType, namespaceResolver);
}
public override object ReadElementContentAs(Type returnType, IXmlNamespaceResolver namespaceResolver, string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadElementContentAs(returnType, namespaceResolver, localName, namespaceURI);
}
public override int AttributeCount
{
get
{
CheckAsync();
return _coreReader.AttributeCount;
}
}
public override string GetAttribute(string name)
{
CheckAsync();
return _coreReader.GetAttribute(name);
}
public override string GetAttribute(string name, string namespaceURI)
{
CheckAsync();
return _coreReader.GetAttribute(name, namespaceURI);
}
public override string GetAttribute(int i)
{
CheckAsync();
return _coreReader.GetAttribute(i);
}
public override string this[int i]
{
get
{
CheckAsync();
return _coreReader[i];
}
}
public override string this[string name]
{
get
{
CheckAsync();
return _coreReader[name];
}
}
public override string this[string name, string namespaceURI]
{
get
{
CheckAsync();
return _coreReader[name, namespaceURI];
}
}
public override bool MoveToAttribute(string name)
{
CheckAsync();
return _coreReader.MoveToAttribute(name);
}
public override bool MoveToAttribute(string name, string ns)
{
CheckAsync();
return _coreReader.MoveToAttribute(name, ns);
}
public override void MoveToAttribute(int i)
{
CheckAsync();
_coreReader.MoveToAttribute(i);
}
public override bool MoveToFirstAttribute()
{
CheckAsync();
return _coreReader.MoveToFirstAttribute();
}
public override bool MoveToNextAttribute()
{
CheckAsync();
return _coreReader.MoveToNextAttribute();
}
public override bool MoveToElement()
{
CheckAsync();
return _coreReader.MoveToElement();
}
public override bool ReadAttributeValue()
{
CheckAsync();
return _coreReader.ReadAttributeValue();
}
public override bool Read()
{
CheckAsync();
return _coreReader.Read();
}
public override bool EOF
{
get
{
CheckAsync();
return _coreReader.EOF;
}
}
public override ReadState ReadState
{
get
{
CheckAsync();
return _coreReader.ReadState;
}
}
public override void Skip()
{
CheckAsync();
_coreReader.Skip();
}
public override XmlNameTable NameTable
{
get
{
CheckAsync();
return _coreReader.NameTable;
}
}
public override string LookupNamespace(string prefix)
{
CheckAsync();
return _coreReader.LookupNamespace(prefix);
}
public override bool CanResolveEntity
{
get
{
CheckAsync();
return _coreReader.CanResolveEntity;
}
}
public override void ResolveEntity()
{
CheckAsync();
_coreReader.ResolveEntity();
}
public override bool CanReadBinaryContent
{
get
{
CheckAsync();
return _coreReader.CanReadBinaryContent;
}
}
public override int ReadContentAsBase64(byte[] buffer, int index, int count)
{
CheckAsync();
return _coreReader.ReadContentAsBase64(buffer, index, count);
}
public override int ReadElementContentAsBase64(byte[] buffer, int index, int count)
{
CheckAsync();
return _coreReader.ReadElementContentAsBase64(buffer, index, count);
}
public override int ReadContentAsBinHex(byte[] buffer, int index, int count)
{
CheckAsync();
return _coreReader.ReadContentAsBinHex(buffer, index, count);
}
public override int ReadElementContentAsBinHex(byte[] buffer, int index, int count)
{
CheckAsync();
return _coreReader.ReadElementContentAsBinHex(buffer, index, count);
}
public override bool CanReadValueChunk
{
get
{
CheckAsync();
return _coreReader.CanReadValueChunk;
}
}
public override int ReadValueChunk(char[] buffer, int index, int count)
{
CheckAsync();
return _coreReader.ReadValueChunk(buffer, index, count);
}
public override XmlNodeType MoveToContent()
{
CheckAsync();
return _coreReader.MoveToContent();
}
public override void ReadStartElement()
{
CheckAsync();
_coreReader.ReadStartElement();
}
public override void ReadStartElement(string name)
{
CheckAsync();
_coreReader.ReadStartElement(name);
}
public override void ReadStartElement(string localname, string ns)
{
CheckAsync();
_coreReader.ReadStartElement(localname, ns);
}
public override void ReadEndElement()
{
CheckAsync();
_coreReader.ReadEndElement();
}
public override bool IsStartElement()
{
CheckAsync();
return _coreReader.IsStartElement();
}
public override bool IsStartElement(string name)
{
CheckAsync();
return _coreReader.IsStartElement(name);
}
public override bool IsStartElement(string localname, string ns)
{
CheckAsync();
return _coreReader.IsStartElement(localname, ns);
}
public override bool ReadToFollowing(string name)
{
CheckAsync();
return _coreReader.ReadToFollowing(name);
}
public override bool ReadToFollowing(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadToFollowing(localName, namespaceURI);
}
public override bool ReadToDescendant(string name)
{
CheckAsync();
return _coreReader.ReadToDescendant(name);
}
public override bool ReadToDescendant(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadToDescendant(localName, namespaceURI);
}
public override bool ReadToNextSibling(string name)
{
CheckAsync();
return _coreReader.ReadToNextSibling(name);
}
public override bool ReadToNextSibling(string localName, string namespaceURI)
{
CheckAsync();
return _coreReader.ReadToNextSibling(localName, namespaceURI);
}
public override string ReadInnerXml()
{
CheckAsync();
return _coreReader.ReadInnerXml();
}
public override string ReadOuterXml()
{
CheckAsync();
return _coreReader.ReadOuterXml();
}
public override XmlReader ReadSubtree()
{
CheckAsync();
XmlReader subtreeReader = _coreReader.ReadSubtree();
return CreateAsyncCheckWrapper(subtreeReader);
}
public override bool HasAttributes
{
get
{
CheckAsync();
return _coreReader.HasAttributes;
}
}
protected override void Dispose(bool disposing)
{
CheckAsync();
//since it is protected method, we can't call coreReader.Dispose(disposing).
//Internal, it is always called to Dipose(true). So call coreReader.Dispose() is OK.
_coreReader.Dispose();
}
#endregion
#region Async Methods
public override Task<string> GetValueAsync()
{
CheckAsync();
var task = _coreReader.GetValueAsync();
_lastTask = task;
return task;
}
public override Task<object> ReadContentAsObjectAsync()
{
CheckAsync();
var task = _coreReader.ReadContentAsObjectAsync();
_lastTask = task;
return task;
}
public override Task<string> ReadContentAsStringAsync()
{
CheckAsync();
var task = _coreReader.ReadContentAsStringAsync();
_lastTask = task;
return task;
}
public override Task<object> ReadContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
{
CheckAsync();
var task = _coreReader.ReadContentAsAsync(returnType, namespaceResolver);
_lastTask = task;
return task;
}
public override Task<object> ReadElementContentAsObjectAsync()
{
CheckAsync();
var task = _coreReader.ReadElementContentAsObjectAsync();
_lastTask = task;
return task;
}
public override Task<string> ReadElementContentAsStringAsync()
{
CheckAsync();
var task = _coreReader.ReadElementContentAsStringAsync();
_lastTask = task;
return task;
}
public override Task<object> ReadElementContentAsAsync(Type returnType, IXmlNamespaceResolver namespaceResolver)
{
CheckAsync();
var task = _coreReader.ReadElementContentAsAsync(returnType, namespaceResolver);
_lastTask = task;
return task;
}
public override Task<bool> ReadAsync()
{
CheckAsync();
var task = _coreReader.ReadAsync();
_lastTask = task;
return task;
}
public override Task SkipAsync()
{
CheckAsync();
var task = _coreReader.SkipAsync();
_lastTask = task;
return task;
}
public override Task<int> ReadContentAsBase64Async(byte[] buffer, int index, int count)
{
CheckAsync();
var task = _coreReader.ReadContentAsBase64Async(buffer, index, count);
_lastTask = task;
return task;
}
public override Task<int> ReadElementContentAsBase64Async(byte[] buffer, int index, int count)
{
CheckAsync();
var task = _coreReader.ReadElementContentAsBase64Async(buffer, index, count);
_lastTask = task;
return task;
}
public override Task<int> ReadContentAsBinHexAsync(byte[] buffer, int index, int count)
{
CheckAsync();
var task = _coreReader.ReadContentAsBinHexAsync(buffer, index, count);
_lastTask = task;
return task;
}
public override Task<int> ReadElementContentAsBinHexAsync(byte[] buffer, int index, int count)
{
CheckAsync();
var task = _coreReader.ReadElementContentAsBinHexAsync(buffer, index, count);
_lastTask = task;
return task;
}
public override Task<int> ReadValueChunkAsync(char[] buffer, int index, int count)
{
CheckAsync();
var task = _coreReader.ReadValueChunkAsync(buffer, index, count);
_lastTask = task;
return task;
}
public override Task<XmlNodeType> MoveToContentAsync()
{
CheckAsync();
var task = _coreReader.MoveToContentAsync();
_lastTask = task;
return task;
}
public override Task<string> ReadInnerXmlAsync()
{
CheckAsync();
var task = _coreReader.ReadInnerXmlAsync();
_lastTask = task;
return task;
}
public override Task<string> ReadOuterXmlAsync()
{
CheckAsync();
var task = _coreReader.ReadOuterXmlAsync();
_lastTask = task;
return task;
}
#endregion
}
internal class XmlAsyncCheckReaderWithNS : XmlAsyncCheckReader, IXmlNamespaceResolver
{
private readonly IXmlNamespaceResolver _readerAsIXmlNamespaceResolver;
public XmlAsyncCheckReaderWithNS(XmlReader reader)
: base(reader)
{
_readerAsIXmlNamespaceResolver = (IXmlNamespaceResolver)reader;
}
#region IXmlNamespaceResolver members
IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope)
{
return _readerAsIXmlNamespaceResolver.GetNamespacesInScope(scope);
}
string IXmlNamespaceResolver.LookupNamespace(string prefix)
{
return _readerAsIXmlNamespaceResolver.LookupNamespace(prefix);
}
string IXmlNamespaceResolver.LookupPrefix(string namespaceName)
{
return _readerAsIXmlNamespaceResolver.LookupPrefix(namespaceName);
}
#endregion
}
internal class XmlAsyncCheckReaderWithLineInfo : XmlAsyncCheckReader, IXmlLineInfo
{
private readonly IXmlLineInfo _readerAsIXmlLineInfo;
public XmlAsyncCheckReaderWithLineInfo(XmlReader reader)
: base(reader)
{
_readerAsIXmlLineInfo = (IXmlLineInfo)reader;
}
#region IXmlLineInfo members
public virtual bool HasLineInfo()
{
return _readerAsIXmlLineInfo.HasLineInfo();
}
public virtual int LineNumber
{
get
{
return _readerAsIXmlLineInfo.LineNumber;
}
}
public virtual int LinePosition
{
get
{
return _readerAsIXmlLineInfo.LinePosition;
}
}
#endregion
}
internal class XmlAsyncCheckReaderWithLineInfoNS : XmlAsyncCheckReaderWithLineInfo, IXmlNamespaceResolver
{
private readonly IXmlNamespaceResolver _readerAsIXmlNamespaceResolver;
public XmlAsyncCheckReaderWithLineInfoNS(XmlReader reader)
: base(reader)
{
_readerAsIXmlNamespaceResolver = (IXmlNamespaceResolver)reader;
}
#region IXmlNamespaceResolver members
IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope(XmlNamespaceScope scope)
{
return _readerAsIXmlNamespaceResolver.GetNamespacesInScope(scope);
}
string IXmlNamespaceResolver.LookupNamespace(string prefix)
{
return _readerAsIXmlNamespaceResolver.LookupNamespace(prefix);
}
string IXmlNamespaceResolver.LookupPrefix(string namespaceName)
{
return _readerAsIXmlNamespaceResolver.LookupPrefix(namespaceName);
}
#endregion
}
}
| 27.289079 | 148 | 0.549043 | [
"MIT"
] | benjamin-bader/corefx | src/System.Xml.ReaderWriter/src/System/Xml/Core/XmlAsyncCheckReader.cs | 25,488 | C# |
using Newtonsoft.Json;
using OCTranspo_Net.Converters;
using OCTranspo_Net.Models.States;
using System;
using System.Globalization;
using System.Text;
namespace OCTranspo_Net.Models
{
public class Trip
{
/// <summary>
/// Final stop on the trip
/// </summary>
[JsonProperty("TripDestination")]
public string TripDestination { get; set; }
/// <summary>
/// start time for the trip. Format HH:MI, where HH = 24 hour format
/// </summary>
/// <remarks>
/// TripStartTime is the scheduled time the run was supposed to leave the first stop.
/// It's only really useful for determining which bus corresponds to which run in a full timetable.
/// @https://www.reddit.com/r/ottawa/comments/epms7d/question_for_programmers_using_the_octranspo_api/femw9sr/
/// </remarks>
[JsonProperty("TripStartTime")]
public string TripStartTime { get; set; }
/// <summary>
/// adjusted scheduled time in minutes
/// </summary>
/// <remarks>
/// AdjustedScheduleTime is the number of minutes after the time of the request (which is not included in the response)
/// that the bus is presumed to arrive, assuming it does not gain or lose time from where it is until it arrives at the stop.
/// For instance, if the scheduled time from Stop A to Stop B is exactly 15 minutes, then any bus located at
/// Stop A (no matter how early or late he was in arriving at Stop A, or how slow or fast the drive to Stop B will be in reality)
/// will be AdjustedScheduleTime "15" in a data request for Stop B.
/// @https://www.reddit.com/r/ottawa/comments/epms7d/question_for_programmers_using_the_octranspo_api/femw9sr/
/// </remarks>
[JsonProperty("AdjustedScheduleTime")]
[JsonConverter(typeof(ParseStringConverter))]
public long AdjustedScheduleTime { get; set; }
/// <summary>
/// The time since the scheduled was adjusted in whole and fractional minutes.
/// </summary>
/// <remarks>
/// If the Adjustment Age is a Negative Value, then it is using the Scheduled Data
/// Otherwise if the result is a Positive Value, then it is based off of GPS
/// </remarks>
[JsonProperty("AdjustmentAge")]
public double AdjustmentAge { get; set; } = double.MinValue;
/// <summary>
/// Last trip to pass the stop for the route and direction
/// </summary>
[JsonProperty("LastTripOfSchedule")]
public bool LastTripOfSchedule { get; set; }
/// <summary>
/// type of bus : low floor, bike rack etc.
/// </summary>
[JsonProperty("BusType")]
public string BusType { get; set; }
/// <summary>
/// Latitude of the last gps reading for the bus
/// </summary>
[JsonProperty("Latitude")]
public string Latitude { get; set; }
/// <summary>
/// Longitude of the last gps reading for the bus
/// </summary>
[JsonProperty("Longitude")]
public string Longitude { get; set; }
/// <summary>
/// speed of the bus in km/hr
/// </summary>
[JsonProperty("GPSSpeed")]
public string GpsSpeed { get; set; }
/// <summary>
/// Checks if this Trip is using the GPS or Schedule
/// </summary>
[JsonIgnore]
public bool IsGpsData { get { return AdjustmentAge >= 0; } }
/// <summary>
/// Where this Trip was Sourced From
/// </summary>
[JsonIgnore]
public TripDataSource TripSource
{
get
{
if (AdjustmentAge == double.MinValue) return TripDataSource.None;
return IsGpsData ? TripDataSource.GPS : TripDataSource.Schedule;
}
}
/// <summary>
/// Gets the TripStartTime converted to a TimeSpan
/// </summary>
/// <returns>The TripStartTime</returns>
public TimeSpan GetTripStartTimeTimespan()
{
var parts = TripStartTime.Split(':');
var hours = int.Parse(parts[0]);
var minutes = int.Parse(parts[1]);
var startTime = new TimeSpan(hours, minutes, 0);
return startTime;
}
/// <summary>
/// Gets when the GPS was last updated (AdjustmentAge), represented as a DateTime from when the Request was made
/// </summary>
/// <param name="timeOfRequest">When the Request was made</param>
/// <returns>DateTime represening when the GPS was last Updated; or Null if not a GPS time</returns>
public DateTime? GetGPSLastUpdatedTime(DateTime timeOfRequest)
{
if (TripSource == TripDataSource.GPS) { return timeOfRequest.AddMinutes(AdjustmentAge); }
return null;
}
}
}
| 38.804688 | 137 | 0.598349 | [
"MIT"
] | killerrin/OC-Transpo-Net | OCTranspo_Net/Models/Trip.cs | 4,969 | 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 _03.BGN_to_EUR_Converter.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_03.BGN_to_EUR_Converter.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
| 38.958333 | 190 | 0.606061 | [
"MIT"
] | delian1986/C-SoftUni-repo | Programming Basics/Win Forms/03. BGN to EUR Converter/Properties/Resources.Designer.cs | 2,807 | C# |
// Copyright (c) Amer Koleci and contributors.
// Distributed under the MIT license. See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using SharpGen.Runtime;
using Vortice.Dxc;
namespace HelloDirect3D12
{
public class ShaderIncludeHandler : CallbackBase, IDxcIncludeHandler
{
private readonly string[] _includeDirectories;
private readonly Dictionary<string, SourceCodeBlob> _sourceFiles = new Dictionary<string, SourceCodeBlob>();
public ShaderIncludeHandler(params string[] includeDirectories)
{
_includeDirectories = includeDirectories;
}
protected override void Dispose(bool disposing)
{
foreach (var pinnedObject in _sourceFiles.Values)
pinnedObject?.Dispose();
_sourceFiles.Clear();
base.Dispose(disposing);
}
public Result LoadSource(string fileName, out IDxcBlob includeSource)
{
if (fileName.StartsWith("./"))
fileName = fileName.Substring(2);
var includeFile = GetFilePath(fileName);
if (string.IsNullOrEmpty(includeFile))
{
includeSource = default;
return Result.Fail;
}
if (!_sourceFiles.TryGetValue(includeFile, out SourceCodeBlob sourceCodeBlob))
{
byte[] data = NewMethod(includeFile);
sourceCodeBlob = new SourceCodeBlob(data);
_sourceFiles.Add(includeFile, sourceCodeBlob);
}
includeSource = sourceCodeBlob.Blob;
return Result.Ok;
}
private static byte[] NewMethod(string includeFile) => File.ReadAllBytes(includeFile);
private string? GetFilePath(string fileName)
{
for (int i = 0; i < _includeDirectories.Length; i++)
{
var filePath = Path.GetFullPath(Path.Combine(_includeDirectories[i], fileName));
if (File.Exists(filePath))
return filePath;
}
return null;
}
private class SourceCodeBlob : IDisposable
{
private byte[] _data;
private GCHandle _dataPointer;
private IDxcBlobEncoding? _blob;
internal IDxcBlob? Blob { get => _blob; }
public SourceCodeBlob(byte[] data)
{
_data = data;
_dataPointer = GCHandle.Alloc(data, GCHandleType.Pinned);
_blob = DxcCompiler.Utils.CreateBlob(_dataPointer.AddrOfPinnedObject(), data.Length, Dxc.DXC_CP_UTF8);
}
public void Dispose()
{
//_blob?.Dispose();
_blob = null;
if (_dataPointer.IsAllocated)
_dataPointer.Free();
_dataPointer = default;
}
}
}
}
| 28.961905 | 118 | 0.578757 | [
"MIT"
] | N500/Vortice.Windows | src/samples/HelloDirect3D12/ShaderIncludeHandler.cs | 3,043 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the ssm-2014-11-06.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.SimpleSystemsManagement.Model
{
/// <summary>
/// This data type is deprecated. Instead, use <a>ParameterStringFilter</a>.
/// </summary>
public partial class ParametersFilter
{
private ParametersFilterKey _key;
private List<string> _values = new List<string>();
/// <summary>
/// Gets and sets the property Key.
/// <para>
/// The name of the filter.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ParametersFilterKey Key
{
get { return this._key; }
set { this._key = value; }
}
// Check to see if Key property is set
internal bool IsSetKey()
{
return this._key != null;
}
/// <summary>
/// Gets and sets the property Values.
/// <para>
/// The filter values.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=50)]
public List<string> Values
{
get { return this._values; }
set { this._values = value; }
}
// Check to see if Values property is set
internal bool IsSetValues()
{
return this._values != null && this._values.Count > 0;
}
}
} | 28.571429 | 101 | 0.602727 | [
"Apache-2.0"
] | FoxBearBear/aws-sdk-net | sdk/src/Services/SimpleSystemsManagement/Generated/Model/ParametersFilter.cs | 2,200 | C# |
// Copyright (c) 2015 Alachisoft
//
// 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.Collections;
using Alachisoft.NCache.Common.DataStructures;
using Alachisoft.NCache.Common.Stats;
namespace Alachisoft.NCache.Caching.Topologies.Local
{
/// <summary>
/// Logs the operation during state transfer
/// </summary>
class OperationLogger
{
LogMode _loggingMode;
private int _bucketId;
private Hashtable _logTbl;
private bool _bucketTransfered = false;
private RedBlack _opIndex;
public OperationLogger(int bucketId, LogMode loggingMode)
{
_bucketId = bucketId;
_opIndex = new RedBlack();
_loggingMode = loggingMode;
}
public LogMode LoggingMode
{
get { return _loggingMode; }
set { _loggingMode = value; }
}
public bool BucketTransfered
{
get { return _bucketTransfered; }
set { _bucketTransfered = value; }
}
public Hashtable LoggedEnteries
{
get
{
Hashtable updatedKeys = null;
Hashtable removedKeys = null;
if (_logTbl == null)
_logTbl = new Hashtable();
_logTbl["updated"] = new Hashtable();
_logTbl["removed"] = new Hashtable();
if (_logTbl.Contains("updated"))
updatedKeys = (Hashtable)_logTbl["updated"];
if (_logTbl.Contains("removed"))
removedKeys = (Hashtable)_logTbl["removed"];
IDictionaryEnumerator rbe = _opIndex.GetEnumerator();
while (rbe.MoveNext())
{
Hashtable tbl = rbe.Value as Hashtable;
OperationInfo info = null;
if (tbl != null)
{
IDictionaryEnumerator ide = tbl.GetEnumerator();
while (ide.MoveNext())
{
info = (OperationInfo)ide.Key;
break;
}
}
switch ((int)info.OpType)
{
case (int)OperationType.Add:
removedKeys.Remove(info.Key);
updatedKeys[info.Key] = info.Entry;
break;
case (int)OperationType.Insert:
removedKeys.Remove(info.Key);
updatedKeys[info.Key] = info.Entry;
break;
case (int)OperationType.Delete:
updatedKeys.Remove(info.Key);
removedKeys[info.Key] = info.Entry;
break;
}
}
return _logTbl;
}
}
public Hashtable LoggedKeys
{
get
{
ArrayList updatedKeys = null;
ArrayList removedKeys = null;
if (_logTbl == null)
_logTbl = new Hashtable();
_logTbl["updated"] = new ArrayList();
_logTbl["removed"] = new ArrayList();
if (_logTbl.Contains("updated"))
updatedKeys = (ArrayList)_logTbl["updated"];
if (_logTbl.Contains("removed"))
removedKeys = (ArrayList)_logTbl["removed"];
IDictionaryEnumerator rbe = _opIndex.GetEnumerator();
while (rbe.MoveNext())
{
Hashtable tbl = rbe.Value as Hashtable;
OperationInfo info = null;
if (tbl != null)
{
IDictionaryEnumerator ide = tbl.GetEnumerator();
while (ide.MoveNext())
{
info = (OperationInfo)ide.Key;
break;
}
}
switch ((int)info.OpType)
{
case (int)OperationType.Add:
removedKeys.Remove(info.Key);
updatedKeys.Add(info.Key);
break;
case (int)OperationType.Insert:
removedKeys.Remove(info.Key);
updatedKeys.Add(info.Key);
break;
case (int)OperationType.Delete:
updatedKeys.Remove(info.Key);
removedKeys.Add(info.Key);
break;
}
}
return _logTbl;
}
}
public void Clear()
{
if (_opIndex != null)
_opIndex.Clear();
}
public void LogOperation(object key, CacheEntry entry, OperationType type)
{
if (_opIndex != null)
_opIndex.Add(HPTime.Now, new OperationInfo(key, entry, type));
}
}
}
| 32.903955 | 82 | 0.461195 | [
"Apache-2.0"
] | NCacheDev/NCache | Src/NCCache/Caching/Topologies/Local/OperationLogger.cs | 5,824 | C# |
// <auto-generated />
using System;
using AutoStoper.Authorization.Data.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace AutoStoper.Authorization.Migrations
{
[DbContext(typeof(AuthDbContext))]
[Migration("20210603084005_userPropertiesUpdate")]
partial class userPropertiesUpdate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("Auth")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.6")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("AutoStoper.Authorization.Data.Database.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Email")
.HasColumnType("nvarchar(max)");
b.Property<string>("FirstName")
.HasColumnType("nvarchar(max)");
b.Property<string>("JwtToken")
.HasColumnType("nvarchar(max)");
b.Property<string>("LastName")
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.HasColumnType("nvarchar(max)");
b.Property<string>("PhoneNumber")
.HasColumnType("nvarchar(max)");
b.Property<byte[]>("UserImage")
.HasColumnType("varbinary(max)");
b.Property<string>("Username")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Korisnici");
});
#pragma warning restore 612, 618
}
}
}
| 36.65625 | 125 | 0.574169 | [
"MIT"
] | ASxCRO/Api-Gateway-.NET | ApiGateway/AutoStoper.Authorization/Migrations/20210603084005_userPropertiesUpdate.Designer.cs | 2,348 | C# |
using System;
using System.Runtime.Serialization;
namespace Shop.Module.ApiProfiler
{
/// <summary>
/// A custom timing that usually represents a Remote Procedure Call, allowing better
/// visibility into these longer-running calls.
/// </summary>
[DataContract]
public class CustomTiming : IDisposable
{
private readonly MiniProfiler _profiler;
private readonly long _startTicks;
private readonly decimal? _minSaveMs;
/// <summary>
/// Don't use this.
/// </summary>
[Obsolete("Used for serialization")]
public CustomTiming() { /* serialization only */ }
/// <summary>
/// Unique identifier for this <see cref="CustomTiming"/>.
/// </summary>
[DataMember(Order = 1)]
public Guid Id { get; set; }
/// <summary>
/// Gets or sets the command that was executed, e.g. "select * from Table" or "INCR my:redis:key"
/// </summary>
[DataMember(Order = 2)]
public string CommandString { get; set; }
// TODO: should this just match the key that the List<CustomTiming> is stored under in Timing.CustomTimings?
/// <summary>
/// Short name describing what kind of custom timing this is, e.g. "Get", "Query", "Fetch".
/// </summary>
[DataMember(Order = 3)]
public string ExecuteType { get; set; }
/// <summary>
/// Gets or sets roughly where in the calling code that this custom timing was executed.
/// </summary>
[DataMember(Order = 4)]
public string StackTraceSnippet { get; set; }
/// <summary>
/// Gets or sets the offset from main <c>MiniProfiler</c> start that this custom command began.
/// </summary>
[DataMember(Order = 5)]
public decimal StartMilliseconds { get; set; }
/// <summary>
/// Gets or sets how long this custom command statement took to execute.
/// </summary>
[DataMember(Order = 6)]
public decimal? DurationMilliseconds { get; set; }
/// <summary>
/// OPTIONAL - how long this timing took to come back initially from the remote server,
/// before all data is fetched and command is completed.
/// </summary>
[DataMember(Order = 7)]
public decimal? FirstFetchDurationMilliseconds { get; set; }
/// <summary>
/// Whether this operation errored.
/// </summary>
[DataMember(Order = 8)]
public bool Errored { get; set; }
internal string Category { get; set; }
/// <summary>
/// OPTIONAL - call after receiving the first response from your Remote Procedure Call to
/// properly set <see cref="FirstFetchDurationMilliseconds"/>.
/// </summary>
public void FirstFetchCompleted()
{
FirstFetchDurationMilliseconds = FirstFetchDurationMilliseconds ?? _profiler.GetDurationMilliseconds(_startTicks);
}
/// <summary>
/// Stops this timing, setting <see cref="DurationMilliseconds"/>.
/// </summary>
public void Stop()
{
DurationMilliseconds = DurationMilliseconds ?? _profiler.GetDurationMilliseconds(_startTicks);
if (_minSaveMs.HasValue && _minSaveMs.Value > 0 && DurationMilliseconds < _minSaveMs.Value)
{
_profiler.Head.RemoveCustomTiming(Category, this);
}
}
void IDisposable.Dispose() => Stop();
/// <summary>
/// Returns <see cref="CommandString"/> for debugging.
/// </summary>
public override string ToString() => CommandString;
}
}
| 35.419048 | 126 | 0.592095 | [
"MIT"
] | LGinC/module-shop | src/server/src/Modules/Shop.Module.ApiProfiler/CustomTiming.cs | 3,721 | C# |
using OakIdeas.Schema.Core.Intangibles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OakIdeas.Schema.Core.Intangibles
{
/// <summary>
/// A property, used to indicate attributes and relationships of some Thing; equivalent to rdf:Property.
/// </summary>
/// <see cref="http://www.schema.org/Property"/>
public class Property : Intangible
{
/// <summary>
/// Relates a property to a class that is (one of) the type(s) the property is expected to be used on.
/// </summary>
public Class DomainIncludes { get; set; }
/// <summary>
/// Relates a property to a class that constitutes (one of) the expected type(s) for values of the property.
/// </summary>
public Class RangeIncludes { get; set; }
}
}
| 33.68 | 116 | 0.646081 | [
"MIT"
] | oakcool/OakIdeas.Schema | OakIdeas.Schema.Core/Intangibles/Property.cs | 844 | 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.HybridCompute.Latest.Inputs
{
/// <summary>
/// Metadata pertaining to the geographic location of the resource.
/// </summary>
public sealed class LocationDataArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The city or locality where the resource is located.
/// </summary>
[Input("city")]
public Input<string>? City { get; set; }
/// <summary>
/// The country or region where the resource is located
/// </summary>
[Input("countryOrRegion")]
public Input<string>? CountryOrRegion { get; set; }
/// <summary>
/// The district, state, or province where the resource is located.
/// </summary>
[Input("district")]
public Input<string>? District { get; set; }
/// <summary>
/// A canonical name for the geographic or physical location.
/// </summary>
[Input("name", required: true)]
public Input<string> Name { get; set; } = null!;
public LocationDataArgs()
{
}
}
}
| 29.87234 | 81 | 0.603989 | [
"Apache-2.0"
] | pulumi/pulumi-azure-nextgen | sdk/dotnet/HybridCompute/Latest/Inputs/LocationDataArgs.cs | 1,404 | C# |
using Microsoft.EntityFrameworkCore;
namespace MarketingBox.Reporting.Service.Postgres
{
public class DatabaseContextFactory
{
private readonly DbContextOptionsBuilder<DatabaseContext> _dbContextOptionsBuilder;
public DatabaseContextFactory(DbContextOptionsBuilder<DatabaseContext> dbContextOptionsBuilder)
{
_dbContextOptionsBuilder = dbContextOptionsBuilder;
}
public DatabaseContext Create()
{
return new DatabaseContext(_dbContextOptionsBuilder.Options);
}
}
} | 29.473684 | 103 | 0.725 | [
"MIT"
] | MyJetMarketingBox/MarketingBox.Reporting.Service | src/MarketingBox.Reporting.Service.Postgres/DatabaseContextFactory.cs | 562 | C# |
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace MixMedia.Hue.Local.Helpers
{
public static class JsonHelper
{
public static async Task<TResponse> GetAsync<TResponse>(this HttpClient client, string requestedUri)
where TResponse : new()
{
var response = await client.GetAsync(requestedUri);
response.EnsureSuccessStatusCode();
return await response.As<TResponse>();
}
public static async Task<TResponse> DeleteAsync<TResponse>(this HttpClient client, string requestedUri)
where TResponse : new()
{
var response = await client.DeleteAsync(requestedUri);
response.EnsureSuccessStatusCode();
return await response.As<TResponse>();
}
public static async Task<TResponse> PostAsync<TRequest, TResponse>(this HttpClient client, string requestedUri, TRequest requestObject)
where TRequest : new()
where TResponse : new()
{
var response = await client.PostAsync(requestedUri,
AsStringContent(requestObject));
response.EnsureSuccessStatusCode();
return await response.As<TResponse>();
}
public static async Task<HttpResponseMessage> PostAsync<TRequest>(this HttpClient client, string requestedUri, TRequest requestObject)
where TRequest : new()
{
return await client.PostAsync(requestedUri,
AsStringContent(requestObject));
}
public static async Task<TResponse> PutAsync<TRequest, TResponse>(this HttpClient client, string requestedUri, TRequest requestObject)
where TRequest : new()
where TResponse : new()
{
var response = await client.PutAsync(requestedUri,
AsStringContent(requestObject));
response.EnsureSuccessStatusCode();
return await response.As<TResponse>();
}
public static StringContent AsStringContent<T>(this T obj)
{
return new StringContent(JsonConvert.SerializeObject(obj), Encoding.UTF8);
}
public static async Task<T> As<T>(this HttpResponseMessage response)
{
return JsonConvert.DeserializeObject<T>
(await response.Content.ReadAsStringAsync());
}
}
}
| 37 | 143 | 0.640581 | [
"MIT"
] | NikoMix/MixMedia.Hue | MixMedia.Hue/Local/Helpers/JsonHelper.cs | 2,481 | C# |
using Work_Force.Interfaces;
using Work_Force.Models;
namespace Work_Force.Entities
{
public class PartTimeEmployee : Emploee, IEmploee
{
public PartTimeEmployee(string name)
: base(name)
{
this.WorkHoursPerWeek = 20;
}
}
} | 20.357143 | 53 | 0.621053 | [
"MIT"
] | Koceto/SoftUni | C# Fundamentals/C# OOP Advanced/Object Communications and Events/Work Force/Entities/PartTimeEmployee.cs | 287 | C# |
using ReactiveListDemo.Model;
using ReactiveUI;
using System;
using System.Reactive.Linq;
namespace ReactiveListDemo.ViewModels
{
public class MainViewModel : ReactiveObject
{
private readonly DataSerivce _dataService;
private ReactiveList<TodoItem> _items;
private int _count;
public ReactiveList<TodoItem> Items
{
get { return _items; }
set { this.RaiseAndSetIfChanged(ref _items, value); }
}
public int Count
{
get { return _count; }
set { this.RaiseAndSetIfChanged(ref _count, value); }
}
public MainViewModel()
{
_dataService = new DataSerivce();
Items = new ReactiveList<TodoItem>();
// Subscribe to the count changed observable so we can update our Count property.
Items.CountChanged.Subscribe(x => Count = x);
// Simply listen to each item as they come in
_dataService.Listen()
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x =>
{
using (Items.SuppressChangeNotifications())
{
Items.Add(x);
}
});
// Buffer incoming data and add them as ranges
//_dataService.Listen()
// .Buffer(TimeSpan.FromSeconds(10), 50)
// .ObserveOn(RxApp.MainThreadScheduler)
// .Subscribe(x =>
//{
// Items.AddRange(x);
//});
// Manually handle the suspending and resetting the list
//_dataService.Listen()
// .Buffer(TimeSpan.FromSeconds(3), 500)
// .ObserveOn(RxApp.MainThreadScheduler)
// .Subscribe(x =>
// {
// using (Items.SuppressChangeNotifications())
// {
// foreach (var item in x)
// {
// Items.Add(item);
// }
// }
// if (x.Any())
// {
// Items.Reset();
// }
// });
Load(10);
}
public void Load(int desiredNumber)
{
_dataService.Load(desiredNumber);
}
}
}
| 28.611765 | 93 | 0.463405 | [
"Unlicense"
] | bitdisaster/parcaticalcode | ReactiveList/ReactiveList/ViewModels/MainViewModel.cs | 2,434 | C# |
using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using CommunityToolkit.Maui.Extensions.Internals;
using Microsoft.Maui.Controls;
namespace CommunityToolkit.Maui.Converters;
/// <summary>
/// Converts/Extracts the incoming value from <see cref="SelectedItemChangedEventArgs"/> object and returns the value of <see cref="SelectedItemChangedEventArgs.SelectedItem"/> property from it.
/// </summary>
public class ItemSelectedEventArgsConverter : ValueConverterExtension, ICommunityToolkitValueConverter
{
/// <summary>
/// Converts/Extracts the incoming value from <see cref="SelectedItemChangedEventArgs"/> object and returns the value of <see cref="SelectedItemChangedEventArgs.SelectedItem"/> property from it.
/// </summary>
/// <param name="value">The value to convert.</param>
/// <param name="targetType">The type of the binding target property. This is not implemented.</param>
/// <param name="parameter">Additional parameter for the converter to handle. This is not implemented.</param>
/// <param name="culture">The culture to use in the converter. This is not implemented.</param>
/// <returns>A <see cref="SelectedItemChangedEventArgs.SelectedItem"/> object from object of type <see cref="SelectedItemChangedEventArgs"/>.</returns>
[return: NotNullIfNotNull("value")]
public object? Convert(object? value, Type? targetType, object? parameter, CultureInfo? culture)
{
if (value == null)
return null;
return value is SelectedItemChangedEventArgs selectedItemChangedEventArgs
? selectedItemChangedEventArgs.SelectedItem
: throw new ArgumentException("Expected value to be of type SelectedItemChangedEventArgs", nameof(value));
}
/// <summary>
/// This method is not implemented and will throw a <see cref="NotImplementedException"/>.
/// </summary>
/// <param name="value">N/A</param>
/// <param name="targetType">N/A</param>
/// <param name="parameter">N/A</param>
/// <param name="culture">N/A</param>
/// <returns>N/A</returns>
public object? ConvertBack(object? value, Type? targetType, object? parameter, CultureInfo? culture)
=> throw new NotImplementedException();
} | 50.186047 | 195 | 0.755792 | [
"MIT"
] | CalvinAllen/Maui | src/CommunityToolkit.Maui/Converters/ItemSelectedEventArgsConverter.shared.cs | 2,160 | C# |
namespace Science.Collections.MultiDimensional.Linq
{
using System;
/// <summary>
/// Provides extensions methods to 2-dimensional arrays.
/// </summary>
public static partial class ExtensionsTo2DArrays
{
/// <summary>
/// Merges two arrays by using the specified predicate function.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="TResult"></typeparam>
/// <param name="source"></param>
/// <param name="second">The second array to merge.</param>
/// <param name="resultSelector">A function that specifies how to merge the elements from the two arrays.</param>
/// <returns></returns>
public static TResult[,] Combine<T1, T2, TResult>(this T1[,] source, T2[,] second, Func<T1, T2, TResult> resultSelector)
{
if (source == null)
throw new ArgumentNullException("source");
if (second == null)
throw new ArgumentNullException("second");
if (resultSelector == null)
throw new ArgumentNullException("resultSelector");
int width = source.GetLength(0),
height = source.GetLength(1);
if (second.GetLength(0) != width)
throw new ArgumentOutOfRangeException("second", "The width of the second array must match the width of the source array.");
if (second.GetLength(1) != height)
throw new ArgumentOutOfRangeException("second", "The height of the second array must match the height of the source array.");
TResult[,] result = new TResult[width, height];
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
result[x, y] = resultSelector(source[x, y], second[x, y]);
return result;
}
/// <summary>
/// Concatenates the elements of a second array horizontally.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="second">The second array to concatenate.</param>
/// <returns></returns>
public static T[,] ConcatHorizontally<T>(this T[,] source, T[,] second)
{
if (source == null)
throw new ArgumentNullException("source");
if (second == null)
throw new ArgumentNullException("second");
int width = source.GetLength(0),
height = source.GetLength(1);
int secondHeight = second.GetLength(1);
if (height != secondHeight)
throw new ArgumentException("The height of the second array must match the height of the source array.");
int secondWidth = second.GetLength(0);
T[,] result = new T[width + secondWidth, height];
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
result[x, y] = source[x, y];
for (int x = 0; x < secondWidth; x++)
for (int y = 0; y < height; y++)
result[secondWidth + x, y] = second[x, y];
return result;
}
/// <summary>
/// Concatenates the elements of a second array vertically.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source"></param>
/// <param name="second">The second array to concatenate.</param>
/// <returns></returns>
public static T[,] ConcatVertically<T>(this T[,] source, T[,] second)
{
if (source == null)
throw new ArgumentNullException("source");
if (second == null)
throw new ArgumentNullException("second");
int width = source.GetLength(0),
height = source.GetLength(1);
int secondWidth = second.GetLength(0);
if (width != secondWidth)
throw new ArgumentOutOfRangeException("second", "The width of the second array must match the width of the source array.");
int secondHeight = second.GetLength(1);
T[,] result = new T[width, height + secondHeight];
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
result[x, y] = source[x, y];
for (int x = 0; x < width; x++)
for (int y = 0; y < secondHeight; y++)
result[x, secondHeight + y] = second[x, y];
return result;
}
/// <summary>
/// Combines two 2D arrays (n × m and m × p) into a new one by combining their elements like a matrix multiplication.
/// </summary>
/// <typeparam name="T1"></typeparam>
/// <typeparam name="T2"></typeparam>
/// <typeparam name="TPartialResult"></typeparam>
/// <typeparam name="TResult"></typeparam>
/// <param name="source"></param>
/// <param name="second">The second array to join.</param>
/// <param name="accumulator">Combines a pair of corresponding elements into a new one. This operation corresponds to the addition in a matrix multiplication.</param>
/// <param name="resultSelector">Aggregates the partial results computed by the <paramref name="accumulator"/> function into a single one, which is one of the elements of the result array. This operation corresponds to the multiplication in a matrix multiplication.</param>
/// <returns></returns>
public static TResult[,] CrossJoin<T1, T2, TPartialResult, TResult>(this T1[,] source, T2[,] second,
Func<T1, T2, TPartialResult> accumulator,
Func<TPartialResult[], TResult> resultSelector
)
{
if (source == null)
throw new ArgumentNullException("source");
if (second == null)
throw new ArgumentNullException("second");
if (accumulator == null)
throw new ArgumentNullException("accumulator");
if (resultSelector == null)
throw new ArgumentNullException("resultSelector");
int firstWidth = source.GetLength(0), firstHeight = source.GetLength(1),
secondWidth = second.GetLength(0), secondHeight = second.GetLength(1);
if (firstHeight != secondWidth)
throw new ArgumentException("The height of the first array must match the width of the second array.");
TResult[,] result = new TResult[firstWidth, secondHeight];
for (int x = 0; x < firstWidth; x++)
for (int y = 0; y < secondHeight; y++)
{
TPartialResult[] partialResult = new TPartialResult[secondHeight];
for (int i = 0; i < secondHeight; i++)
partialResult[i] = accumulator(source[x, i], second[i, y]);
result[x, y] = resultSelector(partialResult);
}
return result;
}
}
} | 40.4 | 281 | 0.558133 | [
"MIT"
] | Peter-Juhasz/HX-Main | src/Science.Collections.MultiDimensional.Linq/2D.Combination.cs | 7,074 | C# |
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using AspAbpSPAMay.EntityFrameworkCore;
namespace AspAbpSPAMay.Migrations
{
[DbContext(typeof(AspAbpSPAMayDbContext))]
[Migration("20170703134115_Remove_IsActive_From_Role")]
partial class Remove_IsActive_From_Role
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
modelBuilder
.HasAnnotation("ProductVersion", "1.1.2")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Abp.Application.Editions.Edition", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(64);
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32);
b.HasKey("Id");
b.ToTable("AbpEditions");
});
modelBuilder.Entity("Abp.Application.Features.FeatureSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("Discriminator")
.IsRequired();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2000);
b.HasKey("Id");
b.ToTable("AbpFeatures");
b.HasDiscriminator<string>("Discriminator").HasValue("FeatureSetting");
});
modelBuilder.Entity("Abp.Auditing.AuditLog", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BrowserInfo")
.HasMaxLength(256);
b.Property<string>("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasMaxLength(128);
b.Property<string>("CustomData")
.HasMaxLength(2000);
b.Property<string>("Exception")
.HasMaxLength(2000);
b.Property<int>("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<int?>("ImpersonatorTenantId");
b.Property<long?>("ImpersonatorUserId");
b.Property<string>("MethodName")
.HasMaxLength(256);
b.Property<string>("Parameters")
.HasMaxLength(1024);
b.Property<string>("ServiceName")
.HasMaxLength(256);
b.Property<int?>("TenantId");
b.Property<long?>("UserId");
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionDuration");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Abp.Authorization.PermissionSetting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("Discriminator")
.IsRequired();
b.Property<bool>("IsGranted");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AbpPermissions");
b.HasDiscriminator<string>("Discriminator").HasValue("PermissionSetting");
});
modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<int>("RoleId");
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("TenantId", "ClaimType");
b.ToTable("AbpRoleClaims");
});
modelBuilder.Entity("Abp.Authorization.Users.UserAccount", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("EmailAddress");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastLoginTime");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.Property<long?>("UserLinkId");
b.Property<string>("UserName");
b.HasKey("Id");
b.HasIndex("EmailAddress");
b.HasIndex("UserName");
b.HasIndex("TenantId", "EmailAddress");
b.HasIndex("TenantId", "UserId");
b.HasIndex("TenantId", "UserName");
b.ToTable("AbpUserAccounts");
});
modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("TenantId", "ClaimType");
b.ToTable("AbpUserClaims");
});
modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("LoginProvider")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(256);
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("TenantId", "UserId");
b.HasIndex("TenantId", "LoginProvider", "ProviderKey");
b.ToTable("AbpUserLogins");
});
modelBuilder.Entity("Abp.Authorization.Users.UserLoginAttempt", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BrowserInfo")
.HasMaxLength(256);
b.Property<string>("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasMaxLength(128);
b.Property<DateTime>("CreationTime");
b.Property<byte>("Result");
b.Property<string>("TenancyName")
.HasMaxLength(64);
b.Property<int?>("TenantId");
b.Property<long?>("UserId");
b.Property<string>("UserNameOrEmailAddress")
.HasMaxLength(255);
b.HasKey("Id");
b.HasIndex("UserId", "TenantId");
b.HasIndex("TenancyName", "UserNameOrEmailAddress", "Result");
b.ToTable("AbpUserLoginAttempts");
});
modelBuilder.Entity("Abp.Authorization.Users.UserOrganizationUnit", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long>("OrganizationUnitId");
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("TenantId", "OrganizationUnitId");
b.HasIndex("TenantId", "UserId");
b.ToTable("AbpUserOrganizationUnits");
});
modelBuilder.Entity("Abp.Authorization.Users.UserRole", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<int>("RoleId");
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("TenantId", "RoleId");
b.HasIndex("TenantId", "UserId");
b.ToTable("AbpUserRoles");
});
modelBuilder.Entity("Abp.Authorization.Users.UserToken", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("LoginProvider");
b.Property<string>("Name");
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.Property<string>("Value");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("TenantId", "UserId");
b.ToTable("AbpUserTokens");
});
modelBuilder.Entity("Abp.BackgroundJobs.BackgroundJobInfo", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<bool>("IsAbandoned");
b.Property<string>("JobArgs")
.IsRequired()
.HasMaxLength(1048576);
b.Property<string>("JobType")
.IsRequired()
.HasMaxLength(512);
b.Property<DateTime?>("LastTryTime");
b.Property<DateTime>("NextTryTime");
b.Property<byte>("Priority");
b.Property<short>("TryCount");
b.HasKey("Id");
b.HasIndex("IsAbandoned", "NextTryTime");
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Abp.Configuration.Setting", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256);
b.Property<int?>("TenantId");
b.Property<long?>("UserId");
b.Property<string>("Value")
.HasMaxLength(2000);
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("TenantId", "Name");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Abp.Localization.ApplicationLanguage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("Icon")
.HasMaxLength(128);
b.Property<bool>("IsDeleted");
b.Property<bool>("IsDisabled");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(10);
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AbpLanguages");
});
modelBuilder.Entity("Abp.Localization.ApplicationLanguageText", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("LanguageName")
.IsRequired()
.HasMaxLength(10);
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Source")
.IsRequired()
.HasMaxLength(128);
b.Property<int?>("TenantId");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(67108864);
b.HasKey("Id");
b.HasIndex("TenantId", "Source", "LanguageName", "Key");
b.ToTable("AbpLanguageTexts");
});
modelBuilder.Entity("Abp.Notifications.NotificationInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("Data")
.HasMaxLength(1048576);
b.Property<string>("DataTypeName")
.HasMaxLength(512);
b.Property<string>("EntityId")
.HasMaxLength(96);
b.Property<string>("EntityTypeAssemblyQualifiedName")
.HasMaxLength(512);
b.Property<string>("EntityTypeName")
.HasMaxLength(250);
b.Property<string>("ExcludedUserIds")
.HasMaxLength(131072);
b.Property<string>("NotificationName")
.IsRequired()
.HasMaxLength(96);
b.Property<byte>("Severity");
b.Property<string>("TenantIds")
.HasMaxLength(131072);
b.Property<string>("UserIds")
.HasMaxLength(131072);
b.HasKey("Id");
b.ToTable("AbpNotifications");
});
modelBuilder.Entity("Abp.Notifications.NotificationSubscriptionInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("EntityId")
.HasMaxLength(96);
b.Property<string>("EntityTypeAssemblyQualifiedName")
.HasMaxLength(512);
b.Property<string>("EntityTypeName")
.HasMaxLength(250);
b.Property<string>("NotificationName")
.HasMaxLength(96);
b.Property<int?>("TenantId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("NotificationName", "EntityTypeName", "EntityId", "UserId");
b.HasIndex("TenantId", "NotificationName", "EntityTypeName", "EntityId", "UserId");
b.ToTable("AbpNotificationSubscriptions");
});
modelBuilder.Entity("Abp.Notifications.TenantNotificationInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<string>("Data")
.HasMaxLength(1048576);
b.Property<string>("DataTypeName")
.HasMaxLength(512);
b.Property<string>("EntityId")
.HasMaxLength(96);
b.Property<string>("EntityTypeAssemblyQualifiedName")
.HasMaxLength(512);
b.Property<string>("EntityTypeName")
.HasMaxLength(250);
b.Property<string>("NotificationName")
.IsRequired()
.HasMaxLength(96);
b.Property<byte>("Severity");
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId");
b.ToTable("AbpTenantNotifications");
});
modelBuilder.Entity("Abp.Notifications.UserNotificationInfo", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime");
b.Property<int>("State");
b.Property<int?>("TenantId");
b.Property<Guid>("TenantNotificationId");
b.Property<long>("UserId");
b.HasKey("Id");
b.HasIndex("UserId", "State", "CreationTime");
b.ToTable("AbpUserNotifications");
});
modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(95);
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128);
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<long?>("ParentId");
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("ParentId");
b.HasIndex("TenantId", "Code");
b.ToTable("AbpOrganizationUnits");
});
modelBuilder.Entity("AspAbpSPAMay.Authorization.Roles.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(5000);
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(64);
b.Property<bool>("IsDefault");
b.Property<bool>("IsDeleted");
b.Property<bool>("IsStatic");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32);
b.Property<string>("NormalizedName")
.IsRequired()
.HasMaxLength(32);
b.Property<int?>("TenantId");
b.HasKey("Id");
b.HasIndex("CreatorUserId");
b.HasIndex("DeleterUserId");
b.HasIndex("LastModifierUserId");
b.HasIndex("TenantId", "NormalizedName");
b.ToTable("AbpRoles");
});
modelBuilder.Entity("AspAbpSPAMay.Authorization.Users.User", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<int>("AccessFailedCount");
b.Property<string>("AuthenticationSource")
.HasMaxLength(64);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<string>("EmailAddress")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("EmailConfirmationCode")
.HasMaxLength(328);
b.Property<bool>("IsActive");
b.Property<bool>("IsDeleted");
b.Property<bool>("IsEmailConfirmed");
b.Property<bool>("IsLockoutEnabled");
b.Property<bool>("IsPhoneNumberConfirmed");
b.Property<bool>("IsTwoFactorEnabled");
b.Property<DateTime?>("LastLoginTime");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<DateTime?>("LockoutEndDateUtc");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(32);
b.Property<string>("NormalizedEmailAddress")
.IsRequired()
.HasMaxLength(256);
b.Property<string>("NormalizedUserName")
.IsRequired()
.HasMaxLength(32);
b.Property<string>("Password")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("PasswordResetCode")
.HasMaxLength(328);
b.Property<string>("PhoneNumber");
b.Property<string>("SecurityStamp");
b.Property<string>("Surname")
.IsRequired()
.HasMaxLength(32);
b.Property<int?>("TenantId");
b.Property<string>("UserName")
.IsRequired()
.HasMaxLength(32);
b.HasKey("Id");
b.HasIndex("CreatorUserId");
b.HasIndex("DeleterUserId");
b.HasIndex("LastModifierUserId");
b.HasIndex("TenantId", "NormalizedEmailAddress");
b.HasIndex("TenantId", "NormalizedUserName");
b.ToTable("AbpUsers");
});
modelBuilder.Entity("AspAbpSPAMay.MultiTenancy.Tenant", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConnectionString")
.HasMaxLength(1024);
b.Property<DateTime>("CreationTime");
b.Property<long?>("CreatorUserId");
b.Property<long?>("DeleterUserId");
b.Property<DateTime?>("DeletionTime");
b.Property<int?>("EditionId");
b.Property<bool>("IsActive");
b.Property<bool>("IsDeleted");
b.Property<DateTime?>("LastModificationTime");
b.Property<long?>("LastModifierUserId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("TenancyName")
.IsRequired()
.HasMaxLength(64);
b.HasKey("Id");
b.HasIndex("CreatorUserId");
b.HasIndex("DeleterUserId");
b.HasIndex("EditionId");
b.HasIndex("LastModifierUserId");
b.HasIndex("TenancyName");
b.ToTable("AbpTenants");
});
modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b =>
{
b.HasBaseType("Abp.Application.Features.FeatureSetting");
b.Property<int>("EditionId");
b.HasIndex("EditionId", "Name");
b.ToTable("AbpFeatures");
b.HasDiscriminator().HasValue("EditionFeatureSetting");
});
modelBuilder.Entity("Abp.MultiTenancy.TenantFeatureSetting", b =>
{
b.HasBaseType("Abp.Application.Features.FeatureSetting");
b.Property<int>("TenantId");
b.HasIndex("TenantId", "Name");
b.ToTable("AbpFeatures");
b.HasDiscriminator().HasValue("TenantFeatureSetting");
});
modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b =>
{
b.HasBaseType("Abp.Authorization.PermissionSetting");
b.Property<int>("RoleId");
b.HasIndex("RoleId");
b.ToTable("AbpPermissions");
b.HasDiscriminator().HasValue("RolePermissionSetting");
});
modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b =>
{
b.HasBaseType("Abp.Authorization.PermissionSetting");
b.Property<long>("UserId");
b.HasIndex("UserId");
b.ToTable("AbpPermissions");
b.HasDiscriminator().HasValue("UserPermissionSetting");
});
modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Roles.Role")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Users.UserRole", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Roles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Users.UserToken", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Configuration.Setting", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Settings")
.HasForeignKey("UserId");
});
modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b =>
{
b.HasOne("Abp.Organizations.OrganizationUnit", "Parent")
.WithMany("Children")
.HasForeignKey("ParentId");
});
modelBuilder.Entity("AspAbpSPAMay.Authorization.Roles.Role", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "CreatorUser")
.WithMany()
.HasForeignKey("CreatorUserId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "DeleterUser")
.WithMany()
.HasForeignKey("DeleterUserId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "LastModifierUser")
.WithMany()
.HasForeignKey("LastModifierUserId");
});
modelBuilder.Entity("AspAbpSPAMay.Authorization.Users.User", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "CreatorUser")
.WithMany()
.HasForeignKey("CreatorUserId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "DeleterUser")
.WithMany()
.HasForeignKey("DeleterUserId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "LastModifierUser")
.WithMany()
.HasForeignKey("LastModifierUserId");
});
modelBuilder.Entity("AspAbpSPAMay.MultiTenancy.Tenant", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "CreatorUser")
.WithMany()
.HasForeignKey("CreatorUserId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "DeleterUser")
.WithMany()
.HasForeignKey("DeleterUserId");
b.HasOne("Abp.Application.Editions.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId");
b.HasOne("AspAbpSPAMay.Authorization.Users.User", "LastModifierUser")
.WithMany()
.HasForeignKey("LastModifierUserId");
});
modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b =>
{
b.HasOne("Abp.Application.Editions.Edition", "Edition")
.WithMany()
.HasForeignKey("EditionId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Roles.Role")
.WithMany("Permissions")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b =>
{
b.HasOne("AspAbpSPAMay.Authorization.Users.User")
.WithMany("Permissions")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade);
});
}
}
}
| 31.800725 | 117 | 0.441295 | [
"MIT"
] | Worthy7/AspAbpSpa | src/AspAbpSPAMay.EntityFrameworkCore/Migrations/20170703134115_Remove_IsActive_From_Role.Designer.cs | 35,110 | C# |
using Armature;
using Armature.Core;
using FluentAssertions;
using JetBrains.Annotations;
using NUnit.Framework;
namespace Tests.Functional
{
public class SingletonTest
{
[Test]
public void should_create_singleton()
{
// --arrange
var target = CreateTarget();
target.Treat<Subject>()
.AsIs()
.AsSingleton();
// --act
var expected = target.Build<Subject>();
var actual = target.Build<Subject>();
// --assert
actual.Should().BeSameAs(expected);
}
[Test]
public void should_create_singleton_via_interface()
{
// --arrange
var target = CreateTarget();
target.Treat<ISubject>()
.AsCreated<Subject>()
.AsSingleton();
// --act
var expected = target.Build<ISubject>();
var actual = target.Build<ISubject>();
// --assert
actual.Should().BeSameAs(expected);
}
[Test]
public void should_create_singleton_if_interface_is_singleton()
{
// --arrange
var target = CreateTarget();
target.Treat<ISubject>()
.AsSingleton();
target.Treat<ISubject>()
.AsCreated<Subject>();
// --act
var expected = target.Build<ISubject>();
var actual = target.Build<ISubject>();
// --assert
actual.Should().BeSameAs(expected);
}
private static Builder CreateTarget()
=> new(BuildStage.Cache, BuildStage.Create)
{
new SkipAllUnits {new IfFirstUnit(new IsConstructor()).UseBuildAction(new GetConstructorWithMaxParametersCount(), BuildStage.Create)}
};
private interface ISubject { }
[UsedImplicitly]
private class Subject : ISubject { }
}
} | 22.448718 | 144 | 0.599657 | [
"Apache-2.0"
] | Ed-ward/Armature | tests/Tests/src/Functional/SingletonTest.cs | 1,751 | 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("Pharmacist")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Pharmacist")]
[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("12a61453-3e1c-4f2a-ac71-759579d0e7f9")]
// 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("2.0.0")]
[assembly: AssemblyFileVersion("2.7.138")]
| 37.594595 | 84 | 0.745507 | [
"MIT"
] | dodther/Pharmacist | Source/Pharmacist/Properties/AssemblyInfo.cs | 1,394 | C# |
using Microsoft.EntityFrameworkCore;
using SW.Mtm.Domain;
using SW.PrimitiveTypes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SW.Mtm.Model;
namespace SW.Mtm.Resources.Accounts
{
class Get : IGetHandler<string>
{
private readonly MtmDbContext dbContext;
private readonly RequestContext requestContext;
public Get(MtmDbContext dbContext, RequestContext requestContext)
{
this.dbContext = dbContext;
this.requestContext = requestContext;
}
public async Task<object> Handle(string accountIdOrEmail, bool lookup = false)
{
if (requestContext.GetNameIdentifier() != accountIdOrEmail &&
requestContext.GetEmail() != accountIdOrEmail &&
!await dbContext.IsRequesterLandlord() &&
!await dbContext.IsRequesterTenantOwner())
throw new SWUnauthorizedException();
var accountQuery = dbContext.Set<Account>()
.Include(a => a.TenantMemberships);
var account = await accountQuery.FirstOrDefaultAsync(i => i.Id == accountIdOrEmail) ??
await accountQuery.Where(i => i.Email == accountIdOrEmail).SingleOrDefaultAsync();
if (account == null)
throw new SWNotFoundException(accountIdOrEmail);
var response = new AccountGet
{
Id = account.Id,
Email = account.Email,
Disabled = account.Disabled,
Phone = account.Phone,
Roles = account.Roles,
CreatedOn = account.CreatedOn,
DisplayName = account.DisplayName,
EmailProvider = account.EmailProvider,
LoginMethods = account.LoginMethods,
ProfileData = account.ProfileData,
SecondFactorMethod = account.SecondFactorMethod,
};
if (requestContext.GetNameIdentifier() == accountIdOrEmail ||
requestContext.GetEmail() == accountIdOrEmail ||
await dbContext.IsRequesterLandlord())
{
response.TenantIdsMemberships = account.TenantMemberships.Select(t => t.TenantId).ToList();
}
return response;
}
}
}
| 34.671429 | 108 | 0.590029 | [
"MIT"
] | simplify9/Mtm | SW.Mtm.Api/Resources/Accounts/Get.cs | 2,429 | C# |
// c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\d3d12.h(2611,1)
namespace DirectN
{
public enum D3D12_RESOURCE_BARRIER_TYPE
{
D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0,
D3D12_RESOURCE_BARRIER_TYPE_ALIASING = 1,
D3D12_RESOURCE_BARRIER_TYPE_UAV = 2,
}
}
| 28 | 82 | 0.711039 | [
"MIT"
] | bbday/DirectN | DirectN/DirectN/Generated/D3D12_RESOURCE_BARRIER_TYPE.cs | 310 | C# |
namespace Blazored.Modal
{
public enum ModalPosition
{
Center,
TopLeft,
TopRight,
BottomLeft,
BottomRight
}
}
| 13.583333 | 29 | 0.533742 | [
"MIT"
] | Codingjames/Modal | src/Blazored.Modal/ModalPosition.cs | 165 | C# |
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static LiteDB.Constants;
namespace LiteDB.Engine
{
/// <summary>
/// The DataPage thats stores object data.
/// </summary>
internal class DataPage : BasePage
{
/// <summary>
/// Read existing DataPage in buffer
/// </summary>
public DataPage(PageBuffer buffer)
: base(buffer)
{
if (this.PageType != PageType.Data) throw new LiteException(0, $"Invalid DataPage buffer on {PageID}");
}
/// <summary>
/// Create new DataPage
/// </summary>
public DataPage(PageBuffer buffer, uint pageID)
: base(buffer, pageID, PageType.Data)
{
}
/// <summary>
/// Get single DataBlock
/// </summary>
public DataBlock GetBlock(byte index)
{
var segment = base.Get(index);
return new DataBlock(this, index, segment);
}
/// <summary>
/// Insert new DataBlock. Use extend to indicate document sequence (document are large than PAGE_SIZE)
/// </summary>
public DataBlock InsertBlock(int bytesLength, bool extend)
{
var segment = base.Insert((ushort)(bytesLength + DataBlock.DATA_BLOCK_FIXED_SIZE), out var index);
return new DataBlock(this, index, segment, extend, PageAddress.Empty);
}
/// <summary>
/// Update current block returning data block to be fill
/// </summary>
public DataBlock UpdateBlock(DataBlock currentBlock, int bytesLength)
{
var segment = base.Update(currentBlock.Position.Index, (ushort)(bytesLength + DataBlock.DATA_BLOCK_FIXED_SIZE));
return new DataBlock(this, currentBlock.Position.Index, segment, currentBlock.Extend, currentBlock.NextBlock);
}
/// <summary>
/// Delete single data block inside this page
/// </summary>
public void DeleteBlock(byte index)
{
base.Delete(index);
}
/// <summary>
/// Get all block positions inside this page that are not extend blocks (initial data block)
/// </summary>
public IEnumerable<PageAddress> GetBlocks(bool onlyDataBlock)
{
foreach(var index in base.GetUsedIndexs())
{
var slotPosition = BasePage.CalcPositionAddr(index);
var position = _buffer.ReadUInt16(slotPosition);
var extend = _buffer.ReadBool(position + DataBlock.P_EXTEND);
if (onlyDataBlock == false || extend == false)
{
yield return new PageAddress(this.PageID, index);
}
}
}
}
} | 32.252874 | 124 | 0.57484 | [
"MIT"
] | 5118234/LiteDB | LiteDB/Engine/Pages/DataPage.cs | 2,808 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
namespace AnyPrefix.Microsoft.Scripting.Runtime {
public enum BinderType {
/// <summary>
/// The MethodBinder will perform normal method binding.
/// </summary>
Normal,
/// <summary>
/// The MethodBinder will return the languages definition of NotImplemented if the arguments are
/// incompatible with the signature.
/// </summary>
BinaryOperator,
ComparisonOperator,
/// <summary>
/// The MethodBinder will set properties/fields for unused keyword arguments on the instance
/// that gets returned from the method.
/// </summary>
Constructor
}
}
| 36.916667 | 104 | 0.646727 | [
"MIT"
] | shuice/IronPython_UWP | ironpython2/Src/DLR/Src/Microsoft.Dynamic/Runtime/BinderType.cs | 886 | 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.Linq;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.IntegrationTests;
using Microsoft.AspNetCore.Razor.TagHelpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.IntegrationTests
{
public class CodeGenerationIntegrationTest : IntegrationTestBase
{
private readonly static CSharpCompilation DefaultBaseCompilation = MvcShim.BaseCompilation.WithAssemblyName("AppCode");
public CodeGenerationIntegrationTest()
: base(generateBaselines: null, projectDirectoryHint: "Microsoft.AspNetCore.Mvc.Razor.Extensions")
{
Configuration = RazorConfiguration.Create(
RazorLanguageVersion.Latest,
"MVC-3.0",
new[] { new AssemblyExtension("MVC-3.0", typeof(ExtensionInitializer).Assembly) });
}
protected override CSharpCompilation BaseCompilation => DefaultBaseCompilation;
protected override RazorConfiguration Configuration { get; }
#region Runtime
[Fact]
public void UsingDirectives_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false, throwOnFailure: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
var diagnostics = compiled.Compilation.GetDiagnostics().Where(d => d.Severity >= DiagnosticSeverity.Warning);
Assert.Equal("The using directive for 'System' appeared previously in this namespace", Assert.Single(diagnostics).GetMessage());
}
[Fact]
public void InvalidNamespaceAtEOF_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ1014", Assert.Single(diagnotics).Id);
}
[Fact]
public void IncompleteDirectives_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyService<TModel>
{
public string Html { get; set; }
}");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
// We expect this test to generate a bunch of errors.
Assert.True(compiled.CodeDocument.GetCSharpDocument().Diagnostics.Count > 0);
}
[Fact]
public void InheritsViewModel_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Razor;
public class MyBasePageForViews<TModel> : RazorPage
{
public override Task ExecuteAsync()
{
throw new System.NotImplementedException();
}
}
public class MyModel
{
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void InheritsWithViewImports_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;
public abstract class MyPageModel<T> : Page
{
public override Task ExecuteAsync()
{
throw new System.NotImplementedException();
}
}
public class MyModel
{
}");
AddProjectItemFromText(@"@inherits MyPageModel<TModel>");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void AttributeDirectiveWithViewImports_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
AddProjectItemFromText(@"
@using System
@attribute [Serializable]");
// Act
var compiled = CompileToAssembly(projectItem, designTime: false, throwOnFailure: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
var diagnostics = compiled.Compilation.GetDiagnostics().Where(d => d.Severity >= DiagnosticSeverity.Warning);
Assert.Equal("Duplicate 'Serializable' attribute", Assert.Single(diagnostics).GetMessage());
}
[Fact]
public void MalformedPageDirective_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ1016", Assert.Single(diagnotics).Id);
}
[Fact]
public void Basic_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void BasicComponent_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile(fileKind: FileKinds.Component);
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact(Skip = "Reenable after CS1701 errors are resolved")]
public void Sections_Runtime()
{
// Arrange
AddCSharpSyntaxTree($@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void _ViewImports_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void Inject_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyApp
{
public string MyProperty { get; set; }
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void InjectWithModel_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyModel
{
}
public class MyService<TModel>
{
public string Html { get; set; }
}
public class MyApp
{
public string MyProperty { get; set; }
}");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void InjectWithSemicolon_Runtime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyModel
{
}
public class MyApp
{
public string MyProperty { get; set; }
}
public class MyService<TModel>
{
public string Html { get; set; }
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void Model_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact(Skip = "Reenable after CS1701 errors are resolved")]
public void ModelExpressionTagHelper_Runtime()
{
// Arrange
AddCSharpSyntaxTree($@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact(Skip = "Reenable after CS1701 errors are resolved")]
public void RazorPages_Runtime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class DivTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void RazorPagesWithRouteTemplate_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact(Skip = "Reenable after CS1701 errors are resolved")]
public void RazorPagesWithoutModel_Runtime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class DivTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void PageWithNamespace_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void ViewWithNamespace_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact(Skip = "Reenable after CS1701 errors are resolved")]
public void ViewComponentTagHelper_Runtime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class TestViewComponent
{{
public string Invoke(string firstName)
{{
return firstName;
}}
}}
[{typeof(HtmlTargetElementAttribute).FullName}]
public class AllTagHelper : {typeof(TagHelper).FullName}
{{
public string Bar {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
}
[Fact]
public void RazorPageWithNoLeadingPageDirective_Runtime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: false);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ3906", Assert.Single(diagnotics).Id);
}
[Fact]
public void RazorPage_WithCssScope()
{
// Arrange
AddCSharpSyntaxTree($@"
[{typeof(HtmlTargetElementAttribute).FullName}({"\"all\""})]
public class AllTagHelper : {typeof(TagHelper).FullName}
{{
public string Bar {{ get; set; }}
}}
[{typeof(HtmlTargetElementAttribute).FullName}({"\"form\""})]
public class FormTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
// Act
// This test case attempts to use all syntaxes that might interact with auto-generated attributes
var generated = CompileToCSharp(@"@page
@addTagHelper *, AppCode
@{
ViewData[""Title""] = ""Home page"";
}
<div class=""text-center"">
<h1 class=""display-4"">Welcome</h1>
<p>Learn about<a href= ""https://docs.microsoft.com/aspnet/core"" > building Web apps with ASP.NET Core</a>.</p>
</div>
<all Bar=""Foo""></all>
<form asp-route=""register"" method=""post"">
<input name=""regular input"" />
</form>
", cssScope: "TestCssScope");
// Assert
var intermediate = generated.CodeDocument.GetDocumentIntermediateNode();
var csharp = generated.CodeDocument.GetCSharpDocument();
AssertDocumentNodeMatchesBaseline(intermediate);
AssertCSharpDocumentMatchesBaseline(csharp);
CompileToAssembly(generated);
}
[Fact]
public void RazorView_WithCssScope()
{
// Arrange
AddCSharpSyntaxTree($@"
[{typeof(HtmlTargetElementAttribute).FullName}({"\"all\""})]
public class AllTagHelper : {typeof(TagHelper).FullName}
{{
public string Bar {{ get; set; }}
}}
[{typeof(HtmlTargetElementAttribute).FullName}({"\"form\""})]
public class FormTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
// Act
// This test case attempts to use all syntaxes that might interact with auto-generated attributes
var generated = CompileToCSharp(@"@addTagHelper *, AppCode
@{
ViewData[""Title""] = ""Home page"";
}
<div class=""text-center"">
<h1 class=""display-4"">Welcome</h1>
<p>Learn about<a href= ""https://docs.microsoft.com/aspnet/core"" > building Web apps with ASP.NET Core</a>.</p>
</div>
<all Bar=""Foo""></all>
<form asp-route=""register"" method=""post"">
<input name=""regular input"" />
</form>
", cssScope: "TestCssScope");
// Assert
var intermediate = generated.CodeDocument.GetDocumentIntermediateNode();
var csharp = generated.CodeDocument.GetCSharpDocument();
AssertDocumentNodeMatchesBaseline(intermediate);
AssertCSharpDocumentMatchesBaseline(csharp);
CompileToAssembly(generated);
}
#endregion
#region DesignTime
[Fact]
public void UsingDirectives_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true, throwOnFailure: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnostics = compiled.Compilation.GetDiagnostics().Where(d => d.Severity >= DiagnosticSeverity.Warning);
Assert.Equal("The using directive for 'System' appeared previously in this namespace", Assert.Single(diagnostics).GetMessage());
}
[Fact]
public void InvalidNamespaceAtEOF_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ1014", Assert.Single(diagnotics).Id);
}
[Fact]
public void IncompleteDirectives_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyService<TModel>
{
public string Html { get; set; }
}");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
// We expect this test to generate a bunch of errors.
Assert.True(compiled.CodeDocument.GetCSharpDocument().Diagnostics.Count > 0);
}
[Fact]
public void InheritsViewModel_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Razor;
public class MyBasePageForViews<TModel> : RazorPage
{
public override Task ExecuteAsync()
{
throw new System.NotImplementedException();
}
}
public class MyModel
{
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void InheritsWithViewImports_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.RazorPages;
public abstract class MyPageModel<T> : Page
{
public override Task ExecuteAsync()
{
throw new System.NotImplementedException();
}
}
public class MyModel
{
}");
AddProjectItemFromText(@"@inherits MyPageModel<TModel>");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void AttributeDirectiveWithViewImports_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
AddProjectItemFromText(@"
@using System
@attribute [Serializable]");
// Act
var compiled = CompileToAssembly(projectItem, designTime: true, throwOnFailure: false);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnostics = compiled.Compilation.GetDiagnostics().Where(d => d.Severity >= DiagnosticSeverity.Warning);
Assert.Equal("Duplicate 'Serializable' attribute", Assert.Single(diagnostics).GetMessage());
}
[Fact]
public void MalformedPageDirective_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ1016", Assert.Single(diagnotics).Id);
}
[Fact]
public void Basic_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void BasicComponent_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile(fileKind: FileKinds.Component);
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void Sections_DesignTime()
{
// Arrange
AddCSharpSyntaxTree($@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void _ViewImports_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void Inject_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyApp
{
public string MyProperty { get; set; }
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void InjectWithModel_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyModel
{
}
public class MyService<TModel>
{
public string Html { get; set; }
}
public class MyApp
{
public string MyProperty { get; set; }
}");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void InjectWithSemicolon_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class MyModel
{
}
public class MyApp
{
public string MyProperty { get; set; }
}
public class MyService<TModel>
{
public string Html { get; set; }
}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void Model_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void MultipleModels_DesignTime()
{
// Arrange
AddCSharpSyntaxTree(@"
public class ThisShouldBeGenerated
{
}");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ2001", Assert.Single(diagnotics).Id);
}
[Fact]
public void ModelExpressionTagHelper_DesignTime()
{
// Arrange
AddCSharpSyntaxTree($@"
using Microsoft.AspNetCore.Mvc.ViewFeatures;
public class InputTestTagHelper : {typeof(TagHelper).FullName}
{{
public ModelExpression For {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void RazorPages_DesignTime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class DivTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void RazorPagesWithRouteTemplate_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void RazorPagesWithoutModel_DesignTime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class DivTagHelper : {typeof(TagHelper).FullName}
{{
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void PageWithNamespace_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void ViewWithNamespace_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void ViewComponentTagHelper_DesignTime()
{
// Arrange
AddCSharpSyntaxTree($@"
public class TestViewComponent
{{
public string Invoke(string firstName)
{{
return firstName;
}}
}}
[{typeof(HtmlTargetElementAttribute).FullName}]
public class AllTagHelper : {typeof(TagHelper).FullName}
{{
public string Bar {{ get; set; }}
}}
");
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToAssembly(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
}
[Fact]
public void RazorPageWithNoLeadingPageDirective_DesignTime()
{
// Arrange
var projectItem = CreateProjectItemFromFile();
// Act
var compiled = CompileToCSharp(projectItem, designTime: true);
// Assert
AssertDocumentNodeMatchesBaseline(compiled.CodeDocument.GetDocumentIntermediateNode());
AssertHtmlDocumentMatchesBaseline(compiled.CodeDocument.GetHtmlDocument());
AssertCSharpDocumentMatchesBaseline(compiled.CodeDocument.GetCSharpDocument());
AssertLinePragmas(compiled.CodeDocument, designTime: true);
AssertSourceMappingsMatchBaseline(compiled.CodeDocument);
var diagnotics = compiled.CodeDocument.GetCSharpDocument().Diagnostics;
Assert.Equal("RZ3906", Assert.Single(diagnotics).Id);
}
#endregion
}
}
| 34.772536 | 140 | 0.658801 | [
"Apache-2.0"
] | 1kevgriff/aspnetcore | src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/IntegrationTests/CodeGenerationIntegrationTest.cs | 41,275 | C# |
using LBH.AdultSocialCare.Transactions.Api.V1.Boundary.InvoiceBoundaries.Response;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace LBH.AdultSocialCare.Transactions.Api.V1.UseCase.PayRunUseCases.Interfaces
{
public interface IGetUniqueInvoiceItemPaymentStatusInPayRunUseCase
{
Task<IEnumerable<InvoiceStatusResponse>> Execute(Guid payRunId);
}
}
| 31.230769 | 83 | 0.817734 | [
"MIT"
] | LBHackney-IT/lbh-adult-social-care-transactions-api | LBH.AdultSocialCare.Transactions.Api/V1/UseCase/PayRunUseCases/Interfaces/IGetUniqueInvoiceItemPaymentStatusInPayRunUseCase.cs | 406 | C# |
// Copyright (c) Pixel Crushers. All rights reserved.
using UnityEngine;
namespace PixelCrushers.DialogueSystem
{
/// <summary>
/// Unity UI template for a quest name button with a toggle for progress tracking.
/// </summary>
[AddComponentMenu("")] // Use wrapper.
public class StandardUIQuestTitleButtonTemplate : StandardUIContentTemplate
{
[Header("Quest Title Button")]
[Tooltip("Button UI element.")]
public UnityEngine.UI.Button button;
[Tooltip("Label text to set on button.")]
public UITextField label;
[Header("Tracking Toggle")]
public StandardUIToggleTemplate trackToggleTemplate;
public virtual void Awake()
{
if (button == null && DialogueDebug.logWarnings) Debug.LogWarning("Dialogue System: UI Button is unassigned.", this);
if (trackToggleTemplate == null && DialogueDebug.logWarnings) Debug.LogWarning("Dialogue System: UI Track Toggle Template is unassigned.", this);
}
public virtual void Assign(string questName, string displayName, ToggleChangedDelegate trackToggleDelegate)
{
if (UITextField.IsNull(label)) label.uiText = button.GetComponentInChildren<UnityEngine.UI.Text>();
name = questName;
label.text = displayName;
var canTrack = QuestLog.IsQuestActive(questName) && QuestLog.IsQuestTrackingAvailable(questName);
trackToggleTemplate.Assign(canTrack, QuestLog.IsQuestTrackingEnabled(questName), questName, trackToggleDelegate);
}
}
}
| 36.090909 | 157 | 0.678212 | [
"CC0-1.0"
] | Bomtill/Co-op-Assessment-1 | Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/UI/Standard/Quest/StandardUIQuestTitleButtonTemplate.cs | 1,590 | C# |
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LrcEditor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LrcEditor")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 28.428571 | 91 | 0.665829 | [
"MIT"
] | SHIINASAMA/lrcdio | LrcEditor/Properties/AssemblyInfo.cs | 2,251 | C# |
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
using Microsoft.eShopWeb.ApplicationCore.Exceptions;
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
using Microsoft.eShopWeb.Infrastructure.Identity;
using Microsoft.eShopWeb.Web.Interfaces;
namespace Microsoft.eShopWeb.Web.Pages.Basket;
[Authorize]
public class CheckoutModel : PageModel
{
private readonly IBasketService _basketService;
private readonly SignInManager<ApplicationUser> _signInManager;
private readonly IOrderService _orderService;
private readonly IOrderReserveService _orderReserveService;
private string _username = null;
private readonly IBasketViewModelService _basketViewModelService;
private readonly IAppLogger<CheckoutModel> _logger;
public CheckoutModel(IBasketService basketService,
IBasketViewModelService basketViewModelService,
SignInManager<ApplicationUser> signInManager,
IOrderService orderService,
IOrderReserveService orderReserveService,
IAppLogger<CheckoutModel> logger)
{
_basketService = basketService;
_signInManager = signInManager;
_orderService = orderService;
_orderReserveService = orderReserveService;
_basketViewModelService = basketViewModelService;
_logger = logger;
}
public BasketViewModel BasketModel { get; set; } = new BasketViewModel();
public async Task OnGet()
{
await SetBasketModelAsync();
}
public async Task<IActionResult> OnPost(IEnumerable<BasketItemViewModel> items)
{
try
{
await SetBasketModelAsync();
if (!ModelState.IsValid)
{
return BadRequest();
}
var updateModel = items.ToDictionary(b => b.Id.ToString(), b => b.Quantity);
await _basketService.SetQuantities(BasketModel.Id, updateModel);
var order = await _orderService.CreateOrderAsync(BasketModel.Id, new Address("123 Main St.", "Kent", "OH", "United States", "44240"));
await _orderReserveService.ReserveOrder(order);
await _basketService.DeleteBasketAsync(BasketModel.Id);
}
catch (EmptyBasketOnCheckoutException emptyBasketOnCheckoutException)
{
//Redirect to Empty Basket page
_logger.LogWarning(emptyBasketOnCheckoutException.Message);
return RedirectToPage("/Basket/Index");
}
return RedirectToPage("Success");
}
private async Task SetBasketModelAsync()
{
if (_signInManager.IsSignedIn(HttpContext.User))
{
BasketModel = await _basketViewModelService.GetOrCreateBasketForUser(User.Identity.Name);
}
else
{
GetOrSetBasketCookieAndUserName();
BasketModel = await _basketViewModelService.GetOrCreateBasketForUser(_username);
}
}
private void GetOrSetBasketCookieAndUserName()
{
if (Request.Cookies.ContainsKey(Constants.BASKET_COOKIENAME))
{
_username = Request.Cookies[Constants.BASKET_COOKIENAME];
}
if (_username != null) return;
_username = Guid.NewGuid().ToString();
var cookieOptions = new CookieOptions();
cookieOptions.Expires = DateTime.Today.AddYears(10);
Response.Cookies.Append(Constants.BASKET_COOKIENAME, _username, cookieOptions);
}
}
| 35.81 | 146 | 0.699525 | [
"MIT"
] | Eduard-Zhyzneuski-Epam/eShopOnWeb | src/Web/Pages/Basket/Checkout.cshtml.cs | 3,583 | C# |
// ========================================
// Project Name : WodiLib
// File Name : MoveType.cs
//
// MIT License Copyright(c) 2019 kameske
// see LICENSE file
// ========================================
using System.Linq;
using WodiLib.Sys;
namespace WodiLib.Event
{
/// <summary>
/// 移動タイプ
/// </summary>
public class MoveType : TypeSafeEnum<MoveType>
{
/// <summary>動かない</summary>
public static readonly MoveType Not;
/// <summary>カスタム</summary>
public static readonly MoveType Custom;
/// <summary>ランダム</summary>
public static readonly MoveType Random;
/// <summary>プレイヤー接近</summary>
public static readonly MoveType Nearer;
/// <summary>値</summary>
public byte Code { get; }
static MoveType()
{
Not = new MoveType("Not", 0x00);
Custom = new MoveType("Custom", 0x01);
Random = new MoveType("Random", 0x02);
Nearer = new MoveType("Nearer", 0x03);
}
private MoveType(string id, byte code) : base(id)
{
Code = code;
}
/// <summary>
/// バイト値からインスタンスを取得する。
/// </summary>
/// <param name="code">バイト値</param>
/// <returns>インスタンス</returns>
public static MoveType FromByte(byte code)
{
return AllItems.First(x => x.Code == code);
}
}
}
| 25.672414 | 58 | 0.48959 | [
"MIT"
] | kameske/WodiLib | WodiLib/WodiLib/Event/Enum/MoveType.cs | 1,595 | C# |
//
// This file describes the API that the generator will produce
//
// Authors:
// Geoff Norton
// Miguel de Icaza
// Aaron Bockover
//
// Copyright 2009, Novell, Inc.
// Copyright 2010, Novell, Inc.
// Copyright 2011-2013 Xamarin Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//
#define DOUBLE_BLOCKS
using ObjCRuntime;
using CloudKit;
using CoreData;
using CoreFoundation;
using Foundation;
using CoreGraphics;
#if HAS_APPCLIP
using AppClip;
#endif
#if IOS
using QuickLook;
#endif
#if !TVOS
using Contacts;
#endif
#if !WATCH
using CoreAnimation;
using CoreSpotlight;
#endif
using CoreMedia;
using SceneKit;
using Security;
#if IOS || MONOMAC
using FileProvider;
#else
using INSFileProviderItem = Foundation.NSObject;
#endif
#if MONOMAC
using AppKit;
using QuickLookUI;
#else
using CoreLocation;
using UIKit;
#endif
using System;
using System.ComponentModel;
// In Apple headers, this is a typedef to a pointer to a private struct
using NSAppleEventManagerSuspensionID = System.IntPtr;
// These two are both four char codes i.e. defined on a uint with constant like 'xxxx'
using AEKeyword = System.UInt32;
using OSType = System.UInt32;
// typedef double NSTimeInterval;
using NSTimeInterval = System.Double;
#if MONOMAC
// dummy usings to make code compile without having the actual types available (for [NoMac] to work)
using NSDirectionalEdgeInsets = Foundation.NSObject;
using UIEdgeInsets = Foundation.NSObject;
using UIOffset = Foundation.NSObject;
using UIPreferredPresentationStyle = Foundation.NSObject;
#else
using NSPasteboard = Foundation.NSObject;
using NSWorkspaceAuthorization = Foundation.NSObject;
using NSStringAttributes = UIKit.UIStringAttributes;
#endif
#if IOS && !__MACCATALYST__
using NSAppleEventSendOptions = Foundation.NSObject;
using NSBezierPath = Foundation.NSObject;
using NSImage = Foundation.NSObject;
#endif
#if TVOS
using NSAppleEventSendOptions = Foundation.NSObject;
using NSBezierPath = Foundation.NSObject;
using NSImage = Foundation.NSObject;
#endif
#if WATCH
// dummy usings to make code compile without having the actual types available (for [NoWatch] to work)
using NSAppleEventSendOptions = Foundation.NSObject;
using NSBezierPath = Foundation.NSObject;
using NSImage = Foundation.NSObject;
using CSSearchableItemAttributeSet = Foundation.NSObject;
#endif
#if WATCH
using CIBarcodeDescriptor = Foundation.NSObject;
#else
using CoreImage;
#endif
#if !IOS
using APActivationPayload = Foundation.NSObject;
#endif
#if __MACCATALYST__
using NSAppleEventSendOptions = Foundation.NSObject;
using NSBezierPath = Foundation.NSObject;
using NSImage = Foundation.NSObject;
#endif
#if IOS || WATCH || TVOS
using NSNotificationSuspensionBehavior = Foundation.NSObject;
using NSNotificationFlags = Foundation.NSObject;
#endif
#if !NET
using NativeHandle = System.IntPtr;
#endif
namespace Foundation {
delegate void NSFilePresenterReacquirer ([BlockCallback] Action reacquirer);
}
namespace Foundation
{
delegate NSComparisonResult NSComparator (NSObject obj1, NSObject obj2);
delegate void NSAttributedRangeCallback (NSDictionary attrs, NSRange range, ref bool stop);
delegate void NSAttributedStringCallback (NSObject value, NSRange range, ref bool stop);
delegate bool NSEnumerateErrorHandler (NSUrl url, NSError error);
delegate void NSMetadataQueryEnumerationCallback (NSObject result, nuint idx, ref bool stop);
#if NET
delegate void NSItemProviderCompletionHandler (INSSecureCoding itemBeingLoaded, NSError error);
#else
delegate void NSItemProviderCompletionHandler (NSObject itemBeingLoaded, NSError error);
#endif
delegate void NSItemProviderLoadHandler ([BlockCallback] NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary options);
delegate void EnumerateDatesCallback (NSDate date, bool exactMatch, ref bool stop);
delegate void EnumerateIndexSetCallback (nuint idx, ref bool stop);
delegate void CloudKitRegistrationPreparationAction ([BlockCallback] CloudKitRegistrationPreparationHandler handler);
delegate void CloudKitRegistrationPreparationHandler (CKShare share, CKContainer container, NSError error);
#if NET
[BaseType (typeof (NSObject))]
interface NSAutoreleasePool {
}
#endif
interface NSArray<TValue> : NSArray {}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRecordValue {
[Export ("count")]
nuint Count { get; }
[Export ("objectAtIndex:")]
NativeHandle ValueAt (nuint idx);
[Static]
[Internal]
[Export ("arrayWithObjects:count:")]
IntPtr FromObjects (IntPtr array, nint count);
[Export ("valueForKey:")]
[MarshalNativeExceptions]
NSObject ValueForKey (NSString key);
[Export ("setValue:forKey:")]
void SetValueForKey (NSObject value, NSString key);
[Deprecated (PlatformName.MacOSX, 10, 15, message : "Use 'Write (NSUrl, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message : "Use 'Write (NSUrl, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message : "Use 'Write (NSUrl, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message : "Use 'Write (NSUrl, out NSError)' instead.")]
[Export ("writeToFile:atomically:")]
bool WriteToFile (string path, bool useAuxiliaryFile);
[Deprecated (PlatformName.MacOSX, 10, 15, message : "Use 'NSMutableArray.FromFile' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message : "Use 'NSMutableArray.FromFile' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message : "Use 'NSMutableArray.FromFile' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message : "Use 'NSMutableArray.FromFile' instead.")]
[Export ("arrayWithContentsOfFile:")][Static]
NSArray FromFile (string path);
[Export ("sortedArrayUsingComparator:")]
NSArray Sort (NSComparator cmptr);
[Export ("filteredArrayUsingPredicate:")]
NSArray Filter (NSPredicate predicate);
[Internal]
[Sealed]
[Export ("containsObject:")]
bool _Contains (NativeHandle anObject);
[Export ("containsObject:")]
bool Contains (NSObject anObject);
[Internal]
[Sealed]
[Export ("indexOfObject:")]
nuint _IndexOf (NativeHandle anObject);
[Export ("indexOfObject:")]
nuint IndexOf (NSObject anObject);
[Export ("addObserver:toObjectsAtIndexes:forKeyPath:options:context:")]
void AddObserver (NSObject observer, NSIndexSet indexes, string keyPath, NSKeyValueObservingOptions options, IntPtr context);
[Export ("removeObserver:fromObjectsAtIndexes:forKeyPath:context:")]
void RemoveObserver (NSObject observer, NSIndexSet indexes, string keyPath, IntPtr context);
[Export ("removeObserver:fromObjectsAtIndexes:forKeyPath:")]
void RemoveObserver (NSObject observer, NSIndexSet indexes, string keyPath);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("writeToURL:error:")]
bool Write (NSUrl url, out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("arrayWithContentsOfURL:error:")]
[return: NullAllowed]
NSArray FromUrl (NSUrl url, out NSError error);
}
#if MONOMAC
interface NSAttributedStringDocumentAttributes { }
#endif
[BaseType (typeof (NSObject))]
partial interface NSAttributedString : NSCoding, NSMutableCopying, NSSecureCoding
#if MONOMAC
, NSPasteboardReading, NSPasteboardWriting
#endif
#if IOS
, NSItemProviderReading, NSItemProviderWriting
#endif
{
#if !WATCH
[Static, Export ("attributedStringWithAttachment:")]
NSAttributedString FromAttachment (NSTextAttachment attachment);
#endif
[Export ("string")]
IntPtr LowLevelValue { get; }
[Export ("attributesAtIndex:effectiveRange:")]
#if NET
IntPtr LowLevelGetAttributes (nint location, IntPtr effectiveRange);
#else
IntPtr LowLevelGetAttributes (nint location, out NSRange effectiveRange);
#endif
[Export ("length")]
nint Length { get; }
// TODO: figure out the type, this deserves to be strongly typed if possble
[Export ("attribute:atIndex:effectiveRange:")]
NSObject GetAttribute (string attribute, nint location, out NSRange effectiveRange);
[Export ("attributedSubstringFromRange:"), Internal]
NSAttributedString Substring (NSRange range);
[Export ("attributesAtIndex:longestEffectiveRange:inRange:")]
NSDictionary GetAttributes (nint location, out NSRange longestEffectiveRange, NSRange rangeLimit);
[Export ("attribute:atIndex:longestEffectiveRange:inRange:")]
NSObject GetAttribute (string attribute, nint location, out NSRange longestEffectiveRange, NSRange rangeLimit);
[Export ("isEqualToAttributedString:")]
bool IsEqual (NSAttributedString other);
[Export ("initWithString:")]
NativeHandle Constructor (string str);
#if !MONOMAC
#if IOS
// New API in iOS9 with same signature as an older alternative.
// We expose only the *new* one for the new platforms as the old
// one was moved to `NSDeprecatedKitAdditions (NSAttributedString)`
[NoMac][NoWatch][NoTV]
[iOS (9,0)]
[Internal]
[Export ("initWithURL:options:documentAttributes:error:")]
IntPtr InitWithURL (NSUrl url, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error);
// but we still need to allow the API to work before iOS 9.0
// and to compleify matters the old one was deprecated in 9.0
[NoMac][NoWatch][NoTV]
[iOS (7,0)]
[Internal]
[Deprecated (PlatformName.iOS, 9, 0)]
[Export ("initWithFileURL:options:documentAttributes:error:")]
IntPtr InitWithFileURL (NSUrl url, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error);
#elif TVOS || WATCH
[NoMac]
[iOS (9,0)]
[Export ("initWithURL:options:documentAttributes:error:")]
NativeHandle Constructor (NSUrl url, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error);
#endif
[NoMac]
[iOS (7,0)]
[Wrap ("this (url, options.GetDictionary (), out resultDocumentAttributes, ref error)")]
NativeHandle Constructor (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Export ("initWithData:options:documentAttributes:error:")]
NativeHandle Constructor (NSData data, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Wrap ("this (data, options.GetDictionary (), out resultDocumentAttributes, ref error)")]
NativeHandle Constructor (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Export ("dataFromRange:documentAttributes:error:")]
NSData GetDataFromRange (NSRange range, NSDictionary attributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Wrap ("GetDataFromRange (range, documentAttributes.GetDictionary ()!, ref error)")]
NSData GetDataFromRange (NSRange range, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Export ("fileWrapperFromRange:documentAttributes:error:")]
NSFileWrapper GetFileWrapperFromRange (NSRange range, NSDictionary attributes, ref NSError error);
[NoMac]
[iOS (7,0)]
[Wrap ("GetFileWrapperFromRange (range, documentAttributes.GetDictionary ()!, ref error)")]
NSFileWrapper GetFileWrapperFromRange (NSRange range, NSAttributedStringDocumentAttributes documentAttributes, ref NSError error);
#endif
[Export ("initWithString:attributes:")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
NativeHandle Constructor (string str, [NullAllowed] NSDictionary attributes);
[Export ("initWithAttributedString:")]
NativeHandle Constructor (NSAttributedString other);
[Export ("enumerateAttributesInRange:options:usingBlock:")]
void EnumerateAttributes (NSRange range, NSAttributedStringEnumeration options, NSAttributedRangeCallback callback);
[Export ("enumerateAttribute:inRange:options:usingBlock:")]
void EnumerateAttribute (NSString attributeName, NSRange inRange, NSAttributedStringEnumeration options, NSAttributedStringCallback callback);
#if MONOMAC
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithData:options:documentAttributes:error:")]
NativeHandle Constructor (NSData data, [NullAllowed] NSDictionary options, out NSDictionary docAttributes, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithDocFormat:documentAttributes:")]
NativeHandle Constructor(NSData wordDocFormat, out NSDictionary docAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithHTML:baseURL:documentAttributes:")]
NativeHandle Constructor (NSData htmlData, NSUrl baseUrl, out NSDictionary docAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("drawWithRect:options:")]
void DrawString (CGRect rect, NSStringDrawingOptions options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithURL:options:documentAttributes:error:")]
NativeHandle Constructor (NSUrl url, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this (url, options.GetDictionary (), out resultDocumentAttributes, out error)")]
NativeHandle Constructor (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this (data, options.GetDictionary (), out resultDocumentAttributes, out error)")]
NativeHandle Constructor (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSAttributedString (NSUrl, NSDictionary, out NSDictionary, ref NSError)' instead.")]
[Export ("initWithPath:documentAttributes:")]
NativeHandle Constructor (string path, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSAttributedString (NSUrl, NSDictionary, out NSDictionary, ref NSError)' instead.")]
[Export ("initWithURL:documentAttributes:")]
NativeHandle Constructor (NSUrl url, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Internal, Export ("initWithRTF:documentAttributes:")]
IntPtr InitWithRtf (NSData data, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Internal, Export ("initWithRTFD:documentAttributes:")]
IntPtr InitWithRtfd (NSData data, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Internal, Export ("initWithHTML:documentAttributes:")]
IntPtr InitWithHTML (NSData data, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithHTML:options:documentAttributes:")]
NativeHandle Constructor (NSData data, [NullAllowed] NSDictionary options, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this (data, options.GetDictionary (), out resultDocumentAttributes)")]
NativeHandle Constructor (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("initWithRTFDFileWrapper:documentAttributes:")]
NativeHandle Constructor (NSFileWrapper wrapper, out NSDictionary resultDocumentAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("containsAttachments")]
bool ContainsAttachments { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("fontAttributesInRange:")]
NSDictionary GetFontAttributes (NSRange range);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("rulerAttributesInRange:")]
NSDictionary GetRulerAttributes (NSRange range);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("lineBreakBeforeIndex:withinRange:")]
nuint GetLineBreak (nuint beforeIndex, NSRange aRange);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("lineBreakByHyphenatingBeforeIndex:withinRange:")]
nuint GetLineBreakByHyphenating (nuint beforeIndex, NSRange aRange);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("doubleClickAtIndex:")]
NSRange DoubleClick (nuint index);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("nextWordFromIndex:forward:")]
nuint GetNextWord (nuint fromIndex, bool isForward);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSDataDetector' instead.")]
[Export ("URLAtIndex:effectiveRange:")]
NSUrl GetUrl (nuint index, out NSRange effectiveRange);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("rangeOfTextBlock:atIndex:")]
NSRange GetRange (NSTextBlock textBlock, nuint index);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("rangeOfTextTable:atIndex:")]
NSRange GetRange (NSTextTable textTable, nuint index);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("rangeOfTextList:atIndex:")]
NSRange GetRange (NSTextList textList, nuint index);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("itemNumberInTextList:atIndex:")]
nint GetItemNumber (NSTextList textList, nuint index);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("dataFromRange:documentAttributes:error:")]
NSData GetData (NSRange range, [NullAllowed] NSDictionary options, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetData (range, options.GetDictionary (), out error)")]
NSData GetData (NSRange range, NSAttributedStringDocumentAttributes options, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("fileWrapperFromRange:documentAttributes:error:")]
NSFileWrapper GetFileWrapper (NSRange range, [NullAllowed] NSDictionary options, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetFileWrapper (range, options.GetDictionary (), out error)")]
NSFileWrapper GetFileWrapper (NSRange range, NSAttributedStringDocumentAttributes options, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("RTFFromRange:documentAttributes:")]
NSData GetRtf (NSRange range, [NullAllowed] NSDictionary options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetRtf (range, options.GetDictionary ())")]
NSData GetRtf (NSRange range, NSAttributedStringDocumentAttributes options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("RTFDFromRange:documentAttributes:")]
NSData GetRtfd (NSRange range, [NullAllowed] NSDictionary options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetRtfd (range, options.GetDictionary ())")]
NSData GetRtfd (NSRange range, NSAttributedStringDocumentAttributes options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("RTFDFileWrapperFromRange:documentAttributes:")]
NSFileWrapper GetRtfdFileWrapper (NSRange range, [NullAllowed] NSDictionary options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetRtfdFileWrapper (range, options.GetDictionary ())")]
NSFileWrapper GetRtfdFileWrapper (NSRange range, NSAttributedStringDocumentAttributes options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("docFormatFromRange:documentAttributes:")]
NSData GetDocFormat (NSRange range, [NullAllowed] NSDictionary options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("this.GetDocFormat (range, options.GetDictionary ())")]
NSData GetDocFormat (NSRange range, NSAttributedStringDocumentAttributes options);
#else
[NoMac]
[Export ("drawWithRect:options:context:")]
void DrawString (CGRect rect, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
[NoMac]
[Export ("boundingRectWithSize:options:context:")]
CGRect GetBoundingRect (CGSize size, NSStringDrawingOptions options, [NullAllowed] NSStringDrawingContext context);
#endif
[MacCatalyst (13, 1)][TV (9, 0)][Mac (10, 0)][iOS (6, 0)]
[Export ("size")]
CGSize Size { get; }
[Export ("drawAtPoint:")]
void DrawString (CGPoint point);
[Export ("drawInRect:")]
void DrawString (CGRect rect);
// -(BOOL)containsAttachmentsInRange:(NSRange)range __attribute__((availability(macosx, introduced=10.11)));
[Mac (10,11)][iOS (9,0)]
[Export ("containsAttachmentsInRange:")]
bool ContainsAttachmentsInRange (NSRange range);
// inlined from NSAttributedStringWebKitAdditions category (since they are all static members)
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Export ("loadFromHTMLWithRequest:options:completionHandler:")]
[PreSnippet ("GC.KeepAlive (WebKit.WKContentMode.Recommended); // no-op to ensure WebKit.framework is loaded into memory", Optimizable = true)]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
void LoadFromHtml (NSUrlRequest request, NSDictionary options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[Wrap ("LoadFromHtml (request, options.GetDictionary ()!, completionHandler)")]
void LoadFromHtml (NSUrlRequest request, NSAttributedStringDocumentAttributes options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Export ("loadFromHTMLWithFileURL:options:completionHandler:")]
[PreSnippet ("GC.KeepAlive (WebKit.WKContentMode.Recommended); // no-op to ensure WebKit.framework is loaded into memory", Optimizable = true)]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
void LoadFromHtml (NSUrl fileUrl, NSDictionary options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[Wrap ("LoadFromHtml (fileUrl, options.GetDictionary ()!, completionHandler)")]
void LoadFromHtml (NSUrl fileUrl, NSAttributedStringDocumentAttributes options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Export ("loadFromHTMLWithString:options:completionHandler:")]
[PreSnippet ("GC.KeepAlive (WebKit.WKContentMode.Recommended); // no-op to ensure WebKit.framework is loaded into memory", Optimizable = true)]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
void LoadFromHtml (string @string, NSDictionary options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[Wrap ("LoadFromHtml (@string, options.GetDictionary ()!, completionHandler)")]
void LoadFromHtml (string @string, NSAttributedStringDocumentAttributes options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Export ("loadFromHTMLWithData:options:completionHandler:")]
[PreSnippet ("GC.KeepAlive (WebKit.WKContentMode.Recommended); // no-op to ensure WebKit.framework is loaded into memory", Optimizable = true)]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
void LoadFromHtml (NSData data, NSDictionary options, NSAttributedStringCompletionHandler completionHandler);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
[Static]
[Async (ResultTypeName = "NSLoadFromHtmlResult")]
[Wrap ("LoadFromHtml (data, options.GetDictionary ()!, completionHandler)")]
void LoadFromHtml (NSData data, NSAttributedStringDocumentAttributes options, NSAttributedStringCompletionHandler completionHandler);
}
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10,15), iOS (13,0)]
delegate void NSAttributedStringCompletionHandler ([NullAllowed] NSAttributedString attributedString, [NullAllowed] NSDictionary<NSString, NSObject> attributes, [NullAllowed] NSError error);
[NoWatch][NoTV] // really inside WKWebKit
[Mac (10, 15), iOS (13, 0)]
[Static][Internal]
interface NSAttributedStringDocumentReadingOptionKeys {
[Field ("NSReadAccessURLDocumentOption", "WebKit")]
NSString ReadAccessUrlKey { get; }
}
[BaseType (typeof (NSObject),
Delegates=new string [] { "WeakDelegate" },
Events=new Type [] { typeof (NSCacheDelegate)} )]
interface NSCache {
[Export ("objectForKey:")]
NSObject ObjectForKey (NSObject key);
[Export ("setObject:forKey:")]
void SetObjectforKey (NSObject obj, NSObject key);
[Export ("setObject:forKey:cost:")]
void SetCost (NSObject obj, NSObject key, nuint cost);
[Export ("removeObjectForKey:")]
void RemoveObjectForKey (NSObject key);
[Export ("removeAllObjects")]
void RemoveAllObjects ();
//Detected properties
[Export ("name")]
string Name { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSCacheDelegate Delegate { get; set; }
[Export ("totalCostLimit")]
nuint TotalCostLimit { get; set; }
[Export ("countLimit")]
nuint CountLimit { get; set; }
[Export ("evictsObjectsWithDiscardedContent")]
bool EvictsObjectsWithDiscardedContent { get; set; }
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSCacheDelegate {
[Export ("cache:willEvictObject:"), EventArgs ("NSObject")]
void WillEvictObject (NSCache cache, NSObject obj);
}
[BaseType (typeof (NSObject), Name="NSCachedURLResponse")]
// instance created with 'init' will crash when Dispose is called
[DisableDefaultCtor]
interface NSCachedUrlResponse : NSCoding, NSSecureCoding, NSCopying {
[Export ("initWithResponse:data:userInfo:storagePolicy:")]
NativeHandle Constructor (NSUrlResponse response, NSData data, [NullAllowed] NSDictionary userInfo, NSUrlCacheStoragePolicy storagePolicy);
[Export ("initWithResponse:data:")]
NativeHandle Constructor (NSUrlResponse response, NSData data);
[Export ("response")]
NSUrlResponse Response { get; }
[Export ("data")]
NSData Data { get; }
[Export ("userInfo")]
NSDictionary UserInfo { get; }
[Export ("storagePolicy")]
NSUrlCacheStoragePolicy StoragePolicy { get; }
}
[BaseType (typeof (NSObject))]
// 'init' returns NIL - `init` now marked as NS_UNAVAILABLE
[DisableDefaultCtor]
interface NSCalendar : NSSecureCoding, NSCopying {
[DesignatedInitializer]
[Export ("initWithCalendarIdentifier:")]
NativeHandle Constructor (NSString identifier);
[Export ("calendarIdentifier")]
string Identifier { get; }
[Export ("currentCalendar")] [Static]
NSCalendar CurrentCalendar { get; }
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("timeZone", ArgumentSemantic.Copy)]
NSTimeZone TimeZone { get; set; }
[Export ("firstWeekday")]
nuint FirstWeekDay { get; set; }
[Export ("minimumDaysInFirstWeek")]
nuint MinimumDaysInFirstWeek { get; set; }
[Export ("components:fromDate:")]
NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate);
[Export ("components:fromDate:toDate:options:")]
NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSCalendarOptions opts);
#if !NET
[Obsolete ("Use the overload with a 'NSCalendarOptions' parameter.")]
[Wrap ("Components (unitFlags, fromDate, toDate, (NSCalendarOptions) opts)")]
NSDateComponents Components (NSCalendarUnit unitFlags, NSDate fromDate, NSDate toDate, NSDateComponentsWrappingBehavior opts);
#endif
[Export ("dateByAddingComponents:toDate:options:")]
NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSCalendarOptions opts);
#if !NET
[Obsolete ("Use the overload with a 'NSCalendarOptions' parameter.")]
[Wrap ("DateByAddingComponents (comps, date, (NSCalendarOptions) opts)")]
NSDate DateByAddingComponents (NSDateComponents comps, NSDate date, NSDateComponentsWrappingBehavior opts);
#endif
[Export ("dateFromComponents:")]
NSDate DateFromComponents (NSDateComponents comps);
[Field ("NSCalendarIdentifierGregorian"), Internal]
NSString NSGregorianCalendar { get; }
[Field ("NSCalendarIdentifierBuddhist"), Internal]
NSString NSBuddhistCalendar { get; }
[Field ("NSCalendarIdentifierChinese"), Internal]
NSString NSChineseCalendar { get; }
[Field ("NSCalendarIdentifierHebrew"), Internal]
NSString NSHebrewCalendar { get; }
[Field ("NSIslamicCalendar"), Internal]
NSString NSIslamicCalendar { get; }
[Field ("NSCalendarIdentifierIslamicCivil"), Internal]
NSString NSIslamicCivilCalendar { get; }
[Field ("NSCalendarIdentifierJapanese"), Internal]
NSString NSJapaneseCalendar { get; }
[Field ("NSCalendarIdentifierRepublicOfChina"), Internal]
NSString NSRepublicOfChinaCalendar { get; }
[Field ("NSCalendarIdentifierPersian"), Internal]
NSString NSPersianCalendar { get; }
[Field ("NSCalendarIdentifierIndian"), Internal]
NSString NSIndianCalendar { get; }
[Field ("NSCalendarIdentifierISO8601"), Internal]
NSString NSISO8601Calendar { get; }
[Field ("NSCalendarIdentifierCoptic"), Internal]
NSString CopticCalendar { get; }
[Field ("NSCalendarIdentifierEthiopicAmeteAlem"), Internal]
NSString EthiopicAmeteAlemCalendar { get; }
[Field ("NSCalendarIdentifierEthiopicAmeteMihret"), Internal]
NSString EthiopicAmeteMihretCalendar { get; }
[Mac(10,10)][iOS(8,0)]
[Field ("NSCalendarIdentifierIslamicTabular"), Internal]
NSString IslamicTabularCalendar { get; }
[Mac(10,10)][iOS(8,0)]
[Field ("NSCalendarIdentifierIslamicUmmAlQura"), Internal]
NSString IslamicUmmAlQuraCalendar { get; }
[Export ("eraSymbols")]
string [] EraSymbols { get; }
[Export ("longEraSymbols")]
string [] LongEraSymbols { get; }
[Export ("monthSymbols")]
string [] MonthSymbols { get; }
[Export ("shortMonthSymbols")]
string [] ShortMonthSymbols { get; }
[Export ("veryShortMonthSymbols")]
string [] VeryShortMonthSymbols { get; }
[Export ("standaloneMonthSymbols")]
string [] StandaloneMonthSymbols { get; }
[Export ("shortStandaloneMonthSymbols")]
string [] ShortStandaloneMonthSymbols { get; }
[Export ("veryShortStandaloneMonthSymbols")]
string [] VeryShortStandaloneMonthSymbols { get; }
[Export ("weekdaySymbols")]
string [] WeekdaySymbols { get; }
[Export ("shortWeekdaySymbols")]
string [] ShortWeekdaySymbols { get; }
[Export ("veryShortWeekdaySymbols")]
string [] VeryShortWeekdaySymbols { get; }
[Export ("standaloneWeekdaySymbols")]
string [] StandaloneWeekdaySymbols { get; }
[Export ("shortStandaloneWeekdaySymbols")]
string [] ShortStandaloneWeekdaySymbols { get; }
[Export ("veryShortStandaloneWeekdaySymbols")]
string [] VeryShortStandaloneWeekdaySymbols { get; }
[Export ("quarterSymbols")]
string [] QuarterSymbols { get; }
[Export ("shortQuarterSymbols")]
string [] ShortQuarterSymbols { get; }
[Export ("standaloneQuarterSymbols")]
string [] StandaloneQuarterSymbols { get; }
[Export ("shortStandaloneQuarterSymbols")]
string [] ShortStandaloneQuarterSymbols { get; }
[Export ("AMSymbol")]
string AMSymbol { get; }
[Export ("PMSymbol")]
string PMSymbol { get; }
[Export ("compareDate:toDate:toUnitGranularity:")]
[Mac(10,9)][iOS(8,0)]
NSComparisonResult CompareDate(NSDate date1, NSDate date2, NSCalendarUnit granularity);
[Export ("component:fromDate:")]
[Mac(10,9)][iOS(8,0)]
nint GetComponentFromDate (NSCalendarUnit unit, NSDate date);
[Export ("components:fromDateComponents:toDateComponents:options:")]
[Mac(10,9)][iOS(8,0)]
NSDateComponents ComponentsFromDateToDate (NSCalendarUnit unitFlags, NSDateComponents startingDate, NSDateComponents resultDate, NSCalendarOptions options);
[Export ("componentsInTimeZone:fromDate:")]
[Mac(10,9)][iOS(8,0)]
NSDateComponents ComponentsInTimeZone (NSTimeZone timezone, NSDate date);
[Export ("date:matchesComponents:")]
[Mac(10,9)][iOS(8,0)]
bool Matches (NSDate date, NSDateComponents components);
[Export ("dateByAddingUnit:value:toDate:options:")]
[Mac(10,9)][iOS(8,0)]
NSDate DateByAddingUnit (NSCalendarUnit unit, nint value, NSDate date, NSCalendarOptions options);
[Export ("dateBySettingHour:minute:second:ofDate:options:")]
[Mac(10,9)][iOS(8,0)]
NSDate DateBySettingsHour (nint hour, nint minute, nint second, NSDate date, NSCalendarOptions options);
[Export ("dateBySettingUnit:value:ofDate:options:")]
[Mac(10,9)][iOS(8,0)]
NSDate DateBySettingUnit (NSCalendarUnit unit, nint value, NSDate date, NSCalendarOptions options);
[Export ("dateWithEra:year:month:day:hour:minute:second:nanosecond:")]
[Mac(10,9)][iOS(8,0)]
NSDate Date (nint era, nint year, nint month, nint date, nint hour, nint minute, nint second, nint nanosecond);
[Export ("dateWithEra:yearForWeekOfYear:weekOfYear:weekday:hour:minute:second:nanosecond:")]
[Mac(10,9)][iOS(8,0)]
NSDate DateForWeekOfYear (nint era, nint year, nint week, nint weekday, nint hour, nint minute, nint second, nint nanosecond);
[Export ("enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:")]
[Mac(10,9)][iOS(8,0)]
void EnumerateDatesStartingAfterDate (NSDate start, NSDateComponents matchingComponents, NSCalendarOptions options, [BlockCallback] EnumerateDatesCallback callback);
[Export ("getEra:year:month:day:fromDate:")]
[Mac(10,9)][iOS(8,0)]
void GetComponentsFromDate (out nint era, out nint year, out nint month, out nint day, NSDate date);
[Export ("getEra:yearForWeekOfYear:weekOfYear:weekday:fromDate:")]
[Mac(10,9)][iOS(8,0)]
void GetComponentsFromDateForWeekOfYear (out nint era, out nint year, out nint weekOfYear, out nint weekday, NSDate date);
[Export ("getHour:minute:second:nanosecond:fromDate:")]
[Mac(10,9)][iOS(8,0)]
void GetHourComponentsFromDate (out nint hour, out nint minute, out nint second, out nint nanosecond, NSDate date);
[Export ("isDate:equalToDate:toUnitGranularity:")]
[Mac(10,9)][iOS(8,0)]
bool IsEqualToUnitGranularity (NSDate date1, NSDate date2, NSCalendarUnit unit);
[Export ("isDate:inSameDayAsDate:")]
[Mac(10,9)][iOS(8,0)]
bool IsInSameDay (NSDate date1, NSDate date2);
[Export ("isDateInToday:")]
[Mac(10,9)][iOS(8,0)]
bool IsDateInToday (NSDate date);
[Export ("isDateInTomorrow:")]
[Mac(10,9)][iOS(8,0)]
bool IsDateInTomorrow (NSDate date);
[Export ("isDateInWeekend:")]
[Mac(10,9)][iOS(8,0)]
bool IsDateInWeekend (NSDate date);
[Export ("isDateInYesterday:")]
[Mac(10,9)][iOS(8,0)]
bool IsDateInYesterday (NSDate date);
[Export ("nextDateAfterDate:matchingComponents:options:")]
[Mac(10,9)][iOS(8,0)]
[MarshalNativeExceptions]
NSDate FindNextDateAfterDateMatching (NSDate date, NSDateComponents components, NSCalendarOptions options);
[Export ("nextDateAfterDate:matchingHour:minute:second:options:")]
[Mac(10,9)][iOS(8,0)]
[MarshalNativeExceptions]
NSDate FindNextDateAfterDateMatching (NSDate date, nint hour, nint minute, nint second, NSCalendarOptions options);
[Export ("nextDateAfterDate:matchingUnit:value:options:")]
[Mac(10,9)][iOS(8,0)]
[MarshalNativeExceptions]
NSDate FindNextDateAfterDateMatching (NSDate date, NSCalendarUnit unit, nint value, NSCalendarOptions options);
[Export ("nextWeekendStartDate:interval:options:afterDate:")]
[Mac(10,9)][iOS(8,0)]
bool FindNextWeekend (out NSDate date, out double /* NSTimeInterval */ interval, NSCalendarOptions options, NSDate afterDate);
[Export ("rangeOfWeekendStartDate:interval:containingDate:")]
[Mac(10,9)][iOS(8,0)]
bool RangeOfWeekendContainingDate (out NSDate weekendStartDate, out double /* NSTimeInterval */ interval, NSDate date);
// although the ideal would be to use GetRange, we already have the method
// RangeOfWeekendContainingDate and for the sake of consistency we are
// going to use the same name pattern.
[Export ("minimumRangeOfUnit:")]
NSRange MinimumRange (NSCalendarUnit unit);
[Export ("maximumRangeOfUnit:")]
NSRange MaximumRange (NSCalendarUnit unit);
[Export ("rangeOfUnit:inUnit:forDate:")]
NSRange Range (NSCalendarUnit smaller, NSCalendarUnit larger, NSDate date);
[Export ("ordinalityOfUnit:inUnit:forDate:")]
nuint Ordinality (NSCalendarUnit smaller, NSCalendarUnit larger, NSDate date);
[Export ("rangeOfUnit:startDate:interval:forDate:")]
bool Range (NSCalendarUnit unit, [NullAllowed] out NSDate datep, out double /* NSTimeInterval */ interval, NSDate date);
[Export ("startOfDayForDate:")]
[Mac(10,9)][iOS(8,0)]
NSDate StartOfDayForDate (NSDate date);
[Mac(10,9)][iOS(8,0)]
[Notification]
[Field ("NSCalendarDayChangedNotification")]
NSString DayChangedNotification { get; }
}
// Obsolete, but the only API surfaced by WebKit.WebHistory.
[Deprecated (PlatformName.MacOSX, 10, 1, message: "Use NSCalendar and NSDateComponents.")]
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[BaseType (typeof (NSDate))]
interface NSCalendarDate {
[Export ("initWithString:calendarFormat:locale:")]
[Deprecated (PlatformName.MacOSX, 10, 0)]
NativeHandle Constructor (string description, string calendarFormat, NSObject locale);
[Export ("initWithString:calendarFormat:")]
[Deprecated (PlatformName.MacOSX, 10, 0)]
NativeHandle Constructor (string description, string calendarFormat);
[Export ("initWithString:")]
[Deprecated (PlatformName.MacOSX, 10, 0)]
NativeHandle Constructor (string description);
[Export ("initWithYear:month:day:hour:minute:second:timeZone:")]
[Deprecated (PlatformName.MacOSX, 10, 0)]
NativeHandle Constructor (nint year, nuint month, nuint day, nuint hour, nuint minute, nuint second, [NullAllowed] NSTimeZone aTimeZone);
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("dateByAddingYears:months:days:hours:minutes:seconds:")]
NSCalendarDate DateByAddingYears (nint year, nint month, nint day, nint hour, nint minute, nint second);
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("dayOfCommonEra")]
nint DayOfCommonEra { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("dayOfMonth")]
nint DayOfMonth { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("dayOfWeek")]
nint DayOfWeek { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("dayOfYear")]
nint DayOfYear { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("hourOfDay")]
nint HourOfDay { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("minuteOfHour")]
nint MinuteOfHour { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("monthOfYear")]
nint MonthOfYear { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("secondOfMinute")]
nint SecondOfMinute { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("yearOfCommonEra")]
nint YearOfCommonEra { get; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("calendarFormat")]
string CalendarFormat { get; set; }
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("descriptionWithCalendarFormat:locale:")]
string GetDescription (string calendarFormat, NSObject locale);
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("descriptionWithCalendarFormat:")]
string GetDescription (string calendarFormat);
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("descriptionWithLocale:")]
string GetDescription (NSLocale locale);
[Deprecated (PlatformName.MacOSX, 10, 0)]
[Export ("timeZone")]
NSTimeZone TimeZone { get; set; }
}
[BaseType (typeof (NSObject))]
interface NSCharacterSet : NSSecureCoding, NSMutableCopying {
[Static, Export ("alphanumericCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Alphanumerics {get;}
[Static, Export ("capitalizedLetterCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Capitalized {get;}
// TODO/FIXME: constructor?
[Static, Export ("characterSetWithBitmapRepresentation:")]
NSCharacterSet FromBitmap (NSData data);
// TODO/FIXME: constructor?
[Static, Export ("characterSetWithCharactersInString:")]
NSCharacterSet FromString (string aString);
[Static, Export ("characterSetWithContentsOfFile:")]
NSCharacterSet FromFile (string path);
[Static, Export ("characterSetWithRange:")]
NSCharacterSet FromRange (NSRange aRange);
[Static, Export ("controlCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Controls {get;}
[Static, Export ("decimalDigitCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet DecimalDigits {get;}
[Static, Export ("decomposableCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Decomposables {get;}
[Static, Export ("illegalCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Illegals {get;}
[Static, Export ("letterCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Letters {get;}
[Static, Export ("lowercaseLetterCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet LowercaseLetters {get;}
[Static, Export ("newlineCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Newlines {get;}
[Static, Export ("nonBaseCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Marks {get;}
[Static, Export ("punctuationCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Punctuation {get;}
[Static, Export ("symbolCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Symbols {get;}
[Static, Export ("uppercaseLetterCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UppercaseLetters {get;}
[Static, Export ("whitespaceAndNewlineCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet WhitespaceAndNewlines {get;}
[Static, Export ("whitespaceCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet Whitespaces {get;}
[Export ("bitmapRepresentation")]
NSData GetBitmapRepresentation ();
[Export ("characterIsMember:")]
bool Contains (char aCharacter);
[Export ("hasMemberInPlane:")]
bool HasMemberInPlane (byte thePlane);
[Export ("invertedSet")]
NSCharacterSet InvertedSet {get;}
[Export ("isSupersetOfSet:")]
bool IsSupersetOf (NSCharacterSet theOtherSet);
[Export ("longCharacterIsMember:")]
bool Contains (uint /* UTF32Char = UInt32 */ theLongChar);
}
[iOS (8,0), Mac(10,10)]
[BaseType (typeof (NSFormatter))]
interface NSMassFormatter {
[Export ("numberFormatter", ArgumentSemantic.Copy)]
NSNumberFormatter NumberFormatter { get; set; }
[Export ("unitStyle")]
NSFormattingUnitStyle UnitStyle { get; set; }
[Export ("forPersonMassUse")]
bool ForPersonMassUse { [Bind ("isForPersonMassUse")] get; set; }
[Export ("stringFromValue:unit:")]
string StringFromValue (double value, NSMassFormatterUnit unit);
[Export ("stringFromKilograms:")]
string StringFromKilograms (double numberInKilograms);
[Export ("unitStringFromValue:unit:")]
string UnitStringFromValue (double value, NSMassFormatterUnit unit);
[Export ("unitStringFromKilograms:usedUnit:")]
string UnitStringFromKilograms (double numberInKilograms, ref NSMassFormatterUnit unitp);
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject obj, string str, out string error);
}
[BaseType (typeof (NSCharacterSet))]
interface NSMutableCharacterSet {
[Export ("addCharactersInRange:")]
void AddCharacters (NSRange aRange);
[Export ("removeCharactersInRange:")]
void RemoveCharacters (NSRange aRange);
[Export ("addCharactersInString:")]
#if MONOMAC && !NET
void AddCharacters (string str);
#else
void AddCharacters (NSString str);
#endif
[Export ("removeCharactersInString:")]
#if MONOMAC && !NET
void RemoveCharacters (string str);
#else
void RemoveCharacters (NSString str);
#endif
[Export ("formUnionWithCharacterSet:")]
void UnionWith (NSCharacterSet otherSet);
[Export ("formIntersectionWithCharacterSet:")]
void IntersectWith (NSCharacterSet otherSet);
[Export ("invert")]
void Invert ();
[Mac(10,10)][iOS(8,0)]
[Static, Export ("alphanumericCharacterSet")]
NSCharacterSet Alphanumerics {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("capitalizedLetterCharacterSet")]
NSCharacterSet Capitalized {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("characterSetWithBitmapRepresentation:")]
NSCharacterSet FromBitmapRepresentation (NSData data);
[Mac(10,10)][iOS(8,0)]
[Static, Export ("characterSetWithCharactersInString:")]
NSCharacterSet FromString (string aString);
[return: NullAllowed]
[Mac(10,10)][iOS(8,0)]
[Static, Export ("characterSetWithContentsOfFile:")]
NSCharacterSet FromFile (string path);
[Mac(10,10)][iOS(8,0)]
[Static, Export ("characterSetWithRange:")]
NSCharacterSet FromRange (NSRange aRange);
[Mac(10,10)][iOS(8,0)]
[Static, Export ("controlCharacterSet")]
NSCharacterSet Controls {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("decimalDigitCharacterSet")]
NSCharacterSet DecimalDigits {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("decomposableCharacterSet")]
NSCharacterSet Decomposables {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("illegalCharacterSet")]
NSCharacterSet Illegals {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("letterCharacterSet")]
NSCharacterSet Letters {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("lowercaseLetterCharacterSet")]
NSCharacterSet LowercaseLetters {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("newlineCharacterSet")]
NSCharacterSet Newlines {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("nonBaseCharacterSet")]
NSCharacterSet Marks {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("punctuationCharacterSet")]
NSCharacterSet Punctuation {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("symbolCharacterSet")]
NSCharacterSet Symbols {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("uppercaseLetterCharacterSet")]
NSCharacterSet UppercaseLetters {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("whitespaceAndNewlineCharacterSet")]
NSCharacterSet WhitespaceAndNewlines {get;}
[Mac(10,10)][iOS(8,0)]
[Static, Export ("whitespaceCharacterSet")]
NSCharacterSet Whitespaces {get;}
}
[BaseType (typeof (NSObject))]
interface NSCoder {
//
// Encoding and decoding
//
[Export ("encodeObject:")]
void Encode ([NullAllowed] NSObject obj);
[Export ("encodeRootObject:")]
void EncodeRoot ([NullAllowed] NSObject obj);
[Export ("decodeObject")]
NSObject DecodeObject ();
//
// Encoding and decoding with keys
//
[Export ("encodeConditionalObject:forKey:")]
void EncodeConditionalObject ([NullAllowed] NSObject val, string key);
[Export ("encodeObject:forKey:")]
void Encode ([NullAllowed] NSObject val, string key);
[Export ("encodeBool:forKey:")]
void Encode (bool val, string key);
[Export ("encodeDouble:forKey:")]
void Encode (double val, string key);
[Export ("encodeFloat:forKey:")]
void Encode (float /* float, not CGFloat */ val, string key);
[Export ("encodeInt32:forKey:")]
void Encode (int /* int32 */ val, string key);
[Export ("encodeInt64:forKey:")]
void Encode (long val, string key);
[Export ("encodeInteger:forKey:")]
void Encode (nint val, string key);
[Export ("encodeBytes:length:forKey:")]
void EncodeBlock (IntPtr bytes, nint length, string key);
[Export ("containsValueForKey:")]
bool ContainsKey (string key);
[Export ("decodeBoolForKey:")]
bool DecodeBool (string key);
[Export ("decodeDoubleForKey:")]
double DecodeDouble (string key);
[Export ("decodeFloatForKey:")]
float DecodeFloat (string key); /* float, not CGFloat */
[Export ("decodeInt32ForKey:")]
int DecodeInt (string key); /* int, not NSInteger */
[Export ("decodeInt64ForKey:")]
long DecodeLong (string key);
[Export ("decodeIntegerForKey:")]
nint DecodeNInt (string key);
[Export ("decodeObjectForKey:")]
NSObject DecodeObject (string key);
[Export ("decodeBytesForKey:returnedLength:")]
IntPtr DecodeBytes (string key, out nuint length);
[Export ("decodeBytesWithReturnedLength:")]
IntPtr DecodeBytes (out nuint length);
[Export ("allowedClasses")]
NSSet AllowedClasses { get; }
[Export ("requiresSecureCoding")]
bool RequiresSecureCoding ();
[iOS (9,0), Mac (10,11)]
[Export ("decodeTopLevelObjectAndReturnError:")]
NSObject DecodeTopLevelObject (out NSError error);
[iOS (9,0), Mac (10,11)]
[Export ("decodeTopLevelObjectForKey:error:")]
NSObject DecodeTopLevelObject (string key, out NSError error);
[iOS (9,0), Mac (10,11)]
[Export ("decodeTopLevelObjectOfClass:forKey:error:")]
NSObject DecodeTopLevelObject (Class klass, string key, out NSError error);
[iOS (9,0), Mac (10,11)]
[Export ("decodeTopLevelObjectOfClasses:forKey:error:")]
NSObject DecodeTopLevelObject ([NullAllowed] NSSet<Class> setOfClasses, string key, out NSError error);
[iOS (9,0), Mac (10,11)]
[Export ("failWithError:")]
void Fail (NSError error);
[Export ("systemVersion")]
uint SystemVersion { get; }
[iOS (9,0)][Mac (10,11)]
[Export ("decodingFailurePolicy")]
NSDecodingFailurePolicy DecodingFailurePolicy { get; }
[iOS (9,0)][Mac (10,11)]
[NullAllowed, Export ("error", ArgumentSemantic.Copy)]
NSError Error { get; }
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("decodeArrayOfObjectsOfClass:forKey:")]
[return: NullAllowed]
NSObject[] DecodeArrayOfObjects (Class @class, string key);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("decodeArrayOfObjectsOfClasses:forKey:")]
[return: NullAllowed]
NSObject[] DecodeArrayOfObjects (NSSet<Class> classes, string key);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("decodeDictionaryWithKeysOfClass:objectsOfClass:forKey:")]
[return: NullAllowed]
NSDictionary DecodeDictionary (Class keyClass, Class objectClass, string key);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("decodeDictionaryWithKeysOfClasses:objectsOfClasses:forKey:")]
[return: NullAllowed]
NSDictionary DecodeDictionary (NSSet<Class> keyClasses, NSSet<Class> objectClasses, string key);
}
[BaseType (typeof (NSPredicate))]
interface NSComparisonPredicate : NSSecureCoding {
[Static, Export ("predicateWithLeftExpression:rightExpression:modifier:type:options:")]
NSComparisonPredicate Create (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
[Static, Export ("predicateWithLeftExpression:rightExpression:customSelector:")]
NSComparisonPredicate FromSelector (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
[DesignatedInitializer]
[Export ("initWithLeftExpression:rightExpression:modifier:type:options:")]
NativeHandle Constructor (NSExpression leftExpression, NSExpression rightExpression, NSComparisonPredicateModifier comparisonModifier, NSPredicateOperatorType operatorType, NSComparisonPredicateOptions comparisonOptions);
[DesignatedInitializer]
[Export ("initWithLeftExpression:rightExpression:customSelector:")]
NativeHandle Constructor (NSExpression leftExpression, NSExpression rightExpression, Selector selector);
[Export ("predicateOperatorType")]
NSPredicateOperatorType PredicateOperatorType { get; }
[Export ("comparisonPredicateModifier")]
NSComparisonPredicateModifier ComparisonPredicateModifier { get; }
[Export ("leftExpression")]
NSExpression LeftExpression { get; }
[Export ("rightExpression")]
NSExpression RightExpression { get; }
[NullAllowed]
[Export ("customSelector")]
Selector CustomSelector { get; }
[Export ("options")]
NSComparisonPredicateOptions Options { get; }
}
[BaseType (typeof (NSPredicate))]
[DisableDefaultCtor] // An uncaught exception was raised: Can't have a NOT predicate with no subpredicate.
interface NSCompoundPredicate : NSCoding {
[DesignatedInitializer]
[Export ("initWithType:subpredicates:")]
NativeHandle Constructor (NSCompoundPredicateType type, NSPredicate[] subpredicates);
[Export ("compoundPredicateType")]
NSCompoundPredicateType Type { get; }
[Export ("subpredicates")]
NSPredicate[] Subpredicates { get; }
[Static]
[Export ("andPredicateWithSubpredicates:")]
NSCompoundPredicate CreateAndPredicate (NSPredicate[] subpredicates);
[Static]
[Export ("orPredicateWithSubpredicates:")]
NSCompoundPredicate CreateOrPredicate (NSPredicate [] subpredicates);
[Static]
[Export ("notPredicateWithSubpredicate:")]
NSCompoundPredicate CreateNotPredicate (NSPredicate predicate);
}
delegate void NSDataByteRangeEnumerator (IntPtr bytes, NSRange range, ref bool stop);
[BaseType (typeof (NSObject))]
interface NSData : NSSecureCoding, NSMutableCopying, CKRecordValue {
[Export ("dataWithContentsOfURL:")]
[Static]
NSData FromUrl (NSUrl url);
[Export ("dataWithContentsOfURL:options:error:")]
[Static]
NSData FromUrl (NSUrl url, NSDataReadingOptions mask, out NSError error);
[Export ("dataWithContentsOfFile:")][Static]
NSData FromFile (string path);
[Export ("dataWithContentsOfFile:options:error:")]
[Static]
NSData FromFile (string path, NSDataReadingOptions mask, out NSError error);
[Export ("dataWithData:")]
[Static]
NSData FromData (NSData source);
[Export ("dataWithBytes:length:"), Static]
NSData FromBytes (IntPtr bytes, nuint size);
[Export ("dataWithBytesNoCopy:length:"), Static]
NSData FromBytesNoCopy (IntPtr bytes, nuint size);
[Export ("dataWithBytesNoCopy:length:freeWhenDone:"), Static]
NSData FromBytesNoCopy (IntPtr bytes, nuint size, bool freeWhenDone);
[Export ("bytes")]
IntPtr Bytes { get; }
[Export ("length")]
nuint Length { get; [NotImplemented ("Not available on NSData, only available on NSMutableData")] set; }
[Export ("writeToFile:options:error:")]
[Internal]
bool _Save (string file, nint options, IntPtr addr);
[Export ("writeToURL:options:error:")]
[Internal]
bool _Save (NSUrl url, nint options, IntPtr addr);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Save (NSUrl,bool)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Save (NSUrl,bool)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Save (NSUrl,bool)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Save (NSUrl,bool)' instead.")]
[Export ("writeToFile:atomically:")]
bool Save (string path, bool atomically);
[Export ("writeToURL:atomically:")]
bool Save (NSUrl url, bool atomically);
[Export ("subdataWithRange:")]
NSData Subdata (NSRange range);
[Export ("getBytes:length:")]
void GetBytes (IntPtr buffer, nuint length);
[Export ("getBytes:range:")]
void GetBytes (IntPtr buffer, NSRange range);
[Export ("rangeOfData:options:range:")]
NSRange Find (NSData dataToFind, NSDataSearchOptions searchOptions, NSRange searchRange);
[iOS (7,0), Mac (10, 9)] // 10.9
[Export ("initWithBase64EncodedString:options:")]
NativeHandle Constructor (string base64String, NSDataBase64DecodingOptions options);
[iOS (7,0), Mac (10, 9)] // 10.9
[Export ("initWithBase64EncodedData:options:")]
NativeHandle Constructor (NSData base64Data, NSDataBase64DecodingOptions options);
[iOS (7,0), Mac (10, 9)] // 10.9
[Export ("base64EncodedDataWithOptions:")]
NSData GetBase64EncodedData (NSDataBase64EncodingOptions options);
[iOS (7,0), Mac (10, 9)] // 10.9
[Export ("base64EncodedStringWithOptions:")]
string GetBase64EncodedString (NSDataBase64EncodingOptions options);
[iOS (7,0), Mac (10, 9)]
[Export ("enumerateByteRangesUsingBlock:")]
void EnumerateByteRange (NSDataByteRangeEnumerator enumerator);
[iOS (7,0), Mac (10, 9)]
[Export ("initWithBytesNoCopy:length:deallocator:")]
NativeHandle Constructor (IntPtr bytes, nuint length, [NullAllowed] Action<IntPtr,nuint> deallocator);
// NSDataCompression (NSData)
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("decompressedDataUsingAlgorithm:error:")]
[return: NullAllowed]
NSData Decompress (NSDataCompressionAlgorithm algorithm, [NullAllowed] out NSError error);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("compressedDataUsingAlgorithm:error:")]
[return: NullAllowed]
NSData Compress (NSDataCompressionAlgorithm algorithm, [NullAllowed] out NSError error);
}
[BaseType (typeof (NSRegularExpression))]
interface NSDataDetector : NSCopying, NSCoding {
[DesignatedInitializer]
[Export ("initWithTypes:error:")]
NativeHandle Constructor (NSTextCheckingTypes options, out NSError error);
[Wrap ("this ((NSTextCheckingTypes) options, out error)")]
NativeHandle Constructor (NSTextCheckingType options, out NSError error);
[Export ("dataDetectorWithTypes:error:"), Static]
NSDataDetector Create (NSTextCheckingTypes checkingTypes, out NSError error);
[Static]
[Wrap ("Create ((NSTextCheckingTypes) checkingTypes, out error)")]
NSDataDetector Create (NSTextCheckingType checkingTypes, out NSError error);
[Export ("checkingTypes")]
NSTextCheckingTypes CheckingTypes { get; }
}
[BaseType (typeof (NSObject))]
interface NSDateComponents : NSSecureCoding, NSCopying, INSCopying, INSSecureCoding, INativeObject {
[NullAllowed] // by default this property is null
[Export ("timeZone", ArgumentSemantic.Copy)]
NSTimeZone TimeZone { get; set; }
[NullAllowed] // by default this property is null
[Export ("calendar", ArgumentSemantic.Copy)]
NSCalendar Calendar { get; set; }
[Export ("quarter")]
nint Quarter { get; set; }
[Export ("date")]
NSDate Date { get; }
//Detected properties
[Export ("era")]
nint Era { get; set; }
[Export ("year")]
nint Year { get; set; }
[Export ("month")]
nint Month { get; set; }
[Export ("day")]
nint Day { get; set; }
[Export ("hour")]
nint Hour { get; set; }
[Export ("minute")]
nint Minute { get; set; }
[Export ("second")]
nint Second { get; set; }
[Export ("nanosecond")]
nint Nanosecond { get; set; }
[Export ("week")]
[Deprecated (PlatformName.MacOSX, 10, 9, message : "Use 'WeekOfMonth' or 'WeekOfYear' instead.")]
[Deprecated (PlatformName.iOS, 7, 0, message : "Use 'WeekOfMonth' or 'WeekOfYear' instead.")]
nint Week { get; set; }
[Export ("weekday")]
nint Weekday { get; set; }
[Export ("weekdayOrdinal")]
nint WeekdayOrdinal { get; set; }
[Export ("weekOfMonth")]
nint WeekOfMonth { get; set; }
[Export ("weekOfYear")]
nint WeekOfYear { get; set; }
[Export ("yearForWeekOfYear")]
nint YearForWeekOfYear { get; set; }
[Export ("leapMonth")]
bool IsLeapMonth { [Bind ("isLeapMonth")] get; set; }
[Export ("isValidDate")]
[Mac(10,9)][iOS(8,0)]
bool IsValidDate { get; }
[Export ("isValidDateInCalendar:")]
[Mac(10,9)][iOS(8,0)]
bool IsValidDateInCalendar (NSCalendar calendar);
[Export ("setValue:forComponent:")]
[Mac(10,9)][iOS(8,0)]
void SetValueForComponent (nint value, NSCalendarUnit unit);
[Export ("valueForComponent:")]
[Mac(10,9)][iOS(8,0)]
nint GetValueForComponent (NSCalendarUnit unit);
}
[BaseType (typeof (NSFormatter))]
interface NSByteCountFormatter {
[Export ("allowsNonnumericFormatting")]
bool AllowsNonnumericFormatting { get; set; }
[Export ("includesUnit")]
bool IncludesUnit { get; set; }
[Export ("includesCount")]
bool IncludesCount { get; set; }
[Export ("includesActualByteCount")]
bool IncludesActualByteCount { get; set; }
[Export ("adaptive")]
bool Adaptive { [Bind ("isAdaptive")] get; set; }
[Export ("zeroPadsFractionDigits")]
bool ZeroPadsFractionDigits { get; set; }
[Static]
[Export ("stringFromByteCount:countStyle:")]
string Format (long byteCount, NSByteCountFormatterCountStyle countStyle);
[Export ("stringFromByteCount:")]
string Format (long byteCount);
[Export ("allowedUnits")]
NSByteCountFormatterUnits AllowedUnits { get; set; }
[Export ("countStyle")]
NSByteCountFormatterCountStyle CountStyle { get; set; }
[iOS (8,0), Mac(10,10)]
[Export ("formattingContext")]
NSFormattingContext FormattingContext { get; set; }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("stringForObjectValue:")]
[return: NullAllowed]
string GetString ([NullAllowed] NSObject obj);
}
[BaseType (typeof (NSFormatter))]
interface NSDateFormatter {
[Export ("stringFromDate:")]
string ToString (NSDate date);
[Export ("dateFromString:")]
NSDate Parse (string date);
[Export ("dateFormat")]
string DateFormat { get; set; }
[Export ("dateStyle")]
NSDateFormatterStyle DateStyle { get; set; }
[Export ("timeStyle")]
NSDateFormatterStyle TimeStyle { get; set; }
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("generatesCalendarDates")]
bool GeneratesCalendarDates { get; set; }
[Export ("formatterBehavior")]
NSDateFormatterBehavior Behavior { get; set; }
[Export ("defaultFormatterBehavior"), Static]
NSDateFormatterBehavior DefaultBehavior { get; set; }
[Export ("timeZone", ArgumentSemantic.Copy)]
NSTimeZone TimeZone { get; set; }
[Export ("calendar", ArgumentSemantic.Copy)]
NSCalendar Calendar { get; set; }
// not exposed as a property in documentation
[Export ("isLenient")]
bool IsLenient { get; [Bind ("setLenient:")] set; }
[Export ("twoDigitStartDate", ArgumentSemantic.Copy)]
NSDate TwoDigitStartDate { get; set; }
[NullAllowed] // by default this property is null
[Export ("defaultDate", ArgumentSemantic.Copy)]
NSDate DefaultDate { get; set; }
[Export ("eraSymbols")]
string [] EraSymbols { get; set; }
[Export ("monthSymbols")]
string [] MonthSymbols { get; set; }
[Export ("shortMonthSymbols")]
string [] ShortMonthSymbols { get; set; }
[Export ("weekdaySymbols")]
string [] WeekdaySymbols { get; set; }
[Export ("shortWeekdaySymbols")]
string [] ShortWeekdaySymbols { get; set; }
[Export ("AMSymbol")]
string AMSymbol { get; set; }
[Export ("PMSymbol")]
string PMSymbol { get; set; }
[Export ("longEraSymbols")]
string [] LongEraSymbols { get; set; }
[Export ("veryShortMonthSymbols")]
string [] VeryShortMonthSymbols { get; set; }
[Export ("standaloneMonthSymbols")]
string [] StandaloneMonthSymbols { get; set; }
[Export ("shortStandaloneMonthSymbols")]
string [] ShortStandaloneMonthSymbols { get; set; }
[Export ("veryShortStandaloneMonthSymbols")]
string [] VeryShortStandaloneMonthSymbols { get; set; }
[Export ("veryShortWeekdaySymbols")]
string [] VeryShortWeekdaySymbols { get; set; }
[Export ("standaloneWeekdaySymbols")]
string [] StandaloneWeekdaySymbols { get; set; }
[Export ("shortStandaloneWeekdaySymbols")]
string [] ShortStandaloneWeekdaySymbols { get; set; }
[Export ("veryShortStandaloneWeekdaySymbols")]
string [] VeryShortStandaloneWeekdaySymbols { get; set; }
[Export ("quarterSymbols")]
string [] QuarterSymbols { get; set; }
[Export ("shortQuarterSymbols")]
string [] ShortQuarterSymbols { get; set; }
[Export ("standaloneQuarterSymbols")]
string [] StandaloneQuarterSymbols { get; set; }
[Export ("shortStandaloneQuarterSymbols")]
string [] ShortStandaloneQuarterSymbols { get; set; }
[Export ("gregorianStartDate", ArgumentSemantic.Copy)]
NSDate GregorianStartDate { get; set; }
[Export ("localizedStringFromDate:dateStyle:timeStyle:")]
[Static]
string ToLocalizedString (NSDate date, NSDateFormatterStyle dateStyle, NSDateFormatterStyle timeStyle);
[Export ("dateFormatFromTemplate:options:locale:")]
[Static]
string GetDateFormatFromTemplate (string template, nuint options, [NullAllowed] NSLocale locale);
[Export ("doesRelativeDateFormatting")]
bool DoesRelativeDateFormatting { get; set; }
[iOS (8,0), Mac (10,10)]
[Export ("setLocalizedDateFormatFromTemplate:")]
void SetLocalizedDateFormatFromTemplate (string dateFormatTemplate);
[Watch (2, 0), TV (9, 0), Mac (10, 10), iOS (8, 0)]
[Export ("formattingContext", ArgumentSemantic.Assign)]
NSFormattingContext FormattingContext { get; set; }
}
[iOS (8,0)][Mac(10,10)]
[BaseType (typeof (NSFormatter))]
interface NSDateComponentsFormatter {
[Export ("unitsStyle")]
NSDateComponentsFormatterUnitsStyle UnitsStyle { get; set; }
[Export ("allowedUnits")]
NSCalendarUnit AllowedUnits { get; set; }
[Export ("zeroFormattingBehavior")]
NSDateComponentsFormatterZeroFormattingBehavior ZeroFormattingBehavior { get; set; }
[Export ("calendar", ArgumentSemantic.Copy)]
NSCalendar Calendar { get; set; }
[Export ("allowsFractionalUnits")]
bool AllowsFractionalUnits { get; set; }
[Export ("maximumUnitCount")]
nint MaximumUnitCount { get; set; }
[Export ("collapsesLargestUnit")]
bool CollapsesLargestUnit { get; set; }
[Export ("includesApproximationPhrase")]
bool IncludesApproximationPhrase { get; set; }
[Export ("includesTimeRemainingPhrase")]
bool IncludesTimeRemainingPhrase { get; set; }
[Export ("formattingContext")]
NSFormattingContext FormattingContext { get; set; }
[Export ("stringForObjectValue:")]
string StringForObjectValue ([NullAllowed] NSObject obj);
[Export ("stringFromDateComponents:")]
string StringFromDateComponents (NSDateComponents components);
[Export ("stringFromDate:toDate:")]
string StringFromDate (NSDate startDate, NSDate endDate);
[Export ("stringFromTimeInterval:")]
string StringFromTimeInterval (double ti);
[Static, Export ("localizedStringFromDateComponents:unitsStyle:")]
string LocalizedStringFromDateComponents (NSDateComponents components, NSDateComponentsFormatterUnitsStyle unitsStyle);
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject obj, string str, out string error);
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("referenceDate", ArgumentSemantic.Copy)]
NSDate ReferenceDate { get; set; }
}
[iOS (8,0)][Mac(10,10)]
[BaseType (typeof (NSFormatter))]
interface NSDateIntervalFormatter {
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("calendar", ArgumentSemantic.Copy)]
NSCalendar Calendar { get; set; }
[Export ("timeZone", ArgumentSemantic.Copy)]
NSTimeZone TimeZone { get; set; }
[Export ("dateTemplate")]
string DateTemplate { get; set; }
[Export ("dateStyle")]
NSDateIntervalFormatterStyle DateStyle { get; set; }
[Export ("timeStyle")]
NSDateIntervalFormatterStyle TimeStyle { get; set; }
[Export ("stringFromDate:toDate:")]
string StringFromDate (NSDate fromDate, NSDate toDate);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("stringFromDateInterval:")]
[return: NullAllowed]
string ToString (NSDateInterval dateInterval);
}
[iOS (8,0)][Mac(10,10)]
[BaseType (typeof (NSFormatter))]
interface NSEnergyFormatter {
[Export ("numberFormatter", ArgumentSemantic.Copy)]
NSNumberFormatter NumberFormatter { get; set; }
[Export ("unitStyle")]
NSFormattingUnitStyle UnitStyle { get; set; }
[Export ("forFoodEnergyUse")]
bool ForFoodEnergyUse { [Bind ("isForFoodEnergyUse")] get; set; }
[Export ("stringFromValue:unit:")]
string StringFromValue (double value, NSEnergyFormatterUnit unit);
[Export ("stringFromJoules:")]
string StringFromJoules (double numberInJoules);
[Export ("unitStringFromValue:unit:")]
string UnitStringFromValue (double value, NSEnergyFormatterUnit unit);
[Export ("unitStringFromJoules:usedUnit:")]
string UnitStringFromJoules (double numberInJoules, out NSEnergyFormatterUnit unitp);
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject obj, string str, out string error);
}
interface NSFileHandleReadEventArgs {
[Export ("NSFileHandleNotificationDataItem")]
NSData AvailableData { get; }
[Export ("NSFileHandleError", ArgumentSemantic.Assign)]
nint UnixErrorCode { get; }
}
interface NSFileHandleConnectionAcceptedEventArgs {
[Export ("NSFileHandleNotificationFileHandleItem")]
NSFileHandle NearSocketConnection { get; }
[Export ("NSFileHandleError", ArgumentSemantic.Assign)]
nint UnixErrorCode { get; }
}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // return invalid handle
interface NSFileHandle : NSSecureCoding {
[Export ("availableData")]
NSData AvailableData ();
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'ReadToEnd (out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'ReadToEnd (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'ReadToEnd (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'ReadToEnd (out NSError)' instead.")]
[Export ("readDataToEndOfFile")]
NSData ReadDataToEndOfFile ();
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("readDataToEndOfFileAndReturnError:")]
[return: NullAllowed]
NSData ReadToEnd ([NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Read (nuint, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Read (nuint, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Read (nuint, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Read (nuint, out NSError)' instead.")]
[Export ("readDataOfLength:")]
NSData ReadDataOfLength (nuint length);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("readDataUpToLength:error:")]
[return: NullAllowed]
NSData Read (nuint length, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Write (out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Write (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Write (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Write (out NSError)' instead.")]
[Export ("writeData:")]
void WriteData (NSData data);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("writeData:error:")]
bool Write (NSData data, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'GetOffset (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'GetOffset (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'GetOffset (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'GetOffset (out ulong, out NSError)' instead.")]
[Export ("offsetInFile")]
ulong OffsetInFile ();
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("getOffset:error:")]
bool GetOffset (out ulong offsetInFile, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'SeekToEnd (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'SeekToEnd (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'SeekToEnd (out ulong, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'SeekToEnd (out ulong, out NSError)' instead.")]
[Export ("seekToEndOfFile")]
ulong SeekToEndOfFile ();
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("seekToEndReturningOffset:error:")]
bool SeekToEnd ([NullAllowed] out ulong offsetInFile, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Seek (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Seek (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Seek (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Seek (ulong, out NSError)' instead.")]
[Export ("seekToFileOffset:")]
void SeekToFileOffset (ulong offset);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("seekToOffset:error:")]
bool Seek (ulong offset, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Truncate (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Truncate (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Truncate (ulong, out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Truncate (ulong, out NSError)' instead.")]
[Export ("truncateFileAtOffset:")]
void TruncateFileAtOffset (ulong offset);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("truncateAtOffset:error:")]
bool Truncate (ulong offset, [NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Synchronize (out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Synchronize (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Synchronize (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Synchronize (out NSError)' instead.")]
[Export ("synchronizeFile")]
void SynchronizeFile ();
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("synchronizeAndReturnError:")]
bool Synchronize ([NullAllowed] out NSError error);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Close (out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Close (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Close (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Close (out NSError)' instead.")]
[Export ("closeFile")]
void CloseFile ();
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("closeAndReturnError:")]
bool Close ([NullAllowed] out NSError error);
[Static]
[Export ("fileHandleWithStandardInput")]
NSFileHandle FromStandardInput ();
[Static]
[Export ("fileHandleWithStandardOutput")]
NSFileHandle FromStandardOutput ();
[Static]
[Export ("fileHandleWithStandardError")]
NSFileHandle FromStandardError ();
[Static]
[Export ("fileHandleWithNullDevice")]
NSFileHandle FromNullDevice ();
[Static]
[Export ("fileHandleForReadingAtPath:")]
NSFileHandle OpenRead (string path);
[Static]
[Export ("fileHandleForWritingAtPath:")]
NSFileHandle OpenWrite (string path);
[Static]
[Export ("fileHandleForUpdatingAtPath:")]
NSFileHandle OpenUpdate (string path);
[Static]
[Export ("fileHandleForReadingFromURL:error:")]
NSFileHandle OpenReadUrl (NSUrl url, out NSError error);
[Static]
[Export ("fileHandleForWritingToURL:error:")]
NSFileHandle OpenWriteUrl (NSUrl url, out NSError error);
[Static]
[Export ("fileHandleForUpdatingURL:error:")]
NSFileHandle OpenUpdateUrl (NSUrl url, out NSError error);
[Export ("readInBackgroundAndNotifyForModes:")]
void ReadInBackground (NSString [] notifyRunLoopModes);
[Wrap ("ReadInBackground (notifyRunLoopModes.GetConstants ())")]
void ReadInBackground (NSRunLoopMode [] notifyRunLoopModes);
[Export ("readInBackgroundAndNotify")]
void ReadInBackground ();
[Export ("readToEndOfFileInBackgroundAndNotifyForModes:")]
void ReadToEndOfFileInBackground (NSString [] notifyRunLoopModes);
[Wrap ("ReadToEndOfFileInBackground (notifyRunLoopModes.GetConstants ())")]
void ReadToEndOfFileInBackground (NSRunLoopMode [] notifyRunLoopModes);
[Export ("readToEndOfFileInBackgroundAndNotify")]
void ReadToEndOfFileInBackground ();
[Export ("acceptConnectionInBackgroundAndNotifyForModes:")]
void AcceptConnectionInBackground (NSString [] notifyRunLoopModes);
[Wrap ("AcceptConnectionInBackground (notifyRunLoopModes.GetConstants ())")]
void AcceptConnectionInBackground (NSRunLoopMode [] notifyRunLoopModes);
[Export ("acceptConnectionInBackgroundAndNotify")]
void AcceptConnectionInBackground ();
[Export ("waitForDataInBackgroundAndNotifyForModes:")]
void WaitForDataInBackground (NSString [] notifyRunLoopModes);
[Wrap ("WaitForDataInBackground (notifyRunLoopModes.GetConstants ())")]
void WaitForDataInBackground (NSRunLoopMode [] notifyRunLoopModes);
[Export ("waitForDataInBackgroundAndNotify")]
void WaitForDataInBackground ();
[DesignatedInitializer]
[Export ("initWithFileDescriptor:closeOnDealloc:")]
NativeHandle Constructor (int /* int, not NSInteger */ fd, bool closeOnDealloc);
[Export ("initWithFileDescriptor:")]
NativeHandle Constructor (int /* int, not NSInteger */ fd);
[Export ("fileDescriptor")]
int FileDescriptor { get; } /* int, not NSInteger */
[Export ("setReadabilityHandler:")]
void SetReadabilityHandler ([NullAllowed] Action<NSFileHandle> readCallback);
[Export ("setWriteabilityHandler:")]
void SetWriteabilityHandle ([NullAllowed] Action<NSFileHandle> writeCallback);
[Field ("NSFileHandleOperationException")]
NSString OperationException { get; }
[Field ("NSFileHandleReadCompletionNotification")]
[Notification (typeof (NSFileHandleReadEventArgs))]
NSString ReadCompletionNotification { get; }
[Field ("NSFileHandleReadToEndOfFileCompletionNotification")]
[Notification (typeof (NSFileHandleReadEventArgs))]
NSString ReadToEndOfFileCompletionNotification { get; }
[Field ("NSFileHandleConnectionAcceptedNotification")]
[Notification (typeof (NSFileHandleConnectionAcceptedEventArgs))]
NSString ConnectionAcceptedNotification { get; }
[Field ("NSFileHandleDataAvailableNotification")]
[Notification]
NSString DataAvailableNotification { get; }
}
[iOS (9,0), Mac(10,11)]
[Static]
interface NSPersonNameComponent {
[Field ("NSPersonNameComponentKey")]
NSString ComponentKey { get; }
[Field ("NSPersonNameComponentGivenName")]
NSString GivenName { get; }
[Field ("NSPersonNameComponentFamilyName")]
NSString FamilyName { get; }
[Field ("NSPersonNameComponentMiddleName")]
NSString MiddleName { get; }
[Field ("NSPersonNameComponentPrefix")]
NSString Prefix { get; }
[Field ("NSPersonNameComponentSuffix")]
NSString Suffix { get; }
[Field ("NSPersonNameComponentNickname")]
NSString Nickname { get; }
[Field ("NSPersonNameComponentDelimiter")]
NSString Delimiter { get; }
}
[iOS (9,0), Mac(10,11)]
[BaseType (typeof(NSObject))]
interface NSPersonNameComponents : NSCopying, NSSecureCoding {
[NullAllowed, Export ("namePrefix")]
string NamePrefix { get; set; }
[NullAllowed, Export ("givenName")]
string GivenName { get; set; }
[NullAllowed, Export ("middleName")]
string MiddleName { get; set; }
[NullAllowed, Export ("familyName")]
string FamilyName { get; set; }
[NullAllowed, Export ("nameSuffix")]
string NameSuffix { get; set; }
[NullAllowed, Export ("nickname")]
string Nickname { get; set; }
[NullAllowed, Export ("phoneticRepresentation", ArgumentSemantic.Copy)]
NSPersonNameComponents PhoneticRepresentation { get; set; }
}
[iOS (9,0), Mac(10,11)]
[BaseType (typeof(NSFormatter))]
interface NSPersonNameComponentsFormatter
{
[Export ("style", ArgumentSemantic.Assign)]
NSPersonNameComponentsFormatterStyle Style { get; set; }
[Export ("phonetic")]
bool Phonetic { [Bind ("isPhonetic")] get; set; }
[Static]
[Export ("localizedStringFromPersonNameComponents:style:options:")]
string GetLocalizedString (NSPersonNameComponents components, NSPersonNameComponentsFormatterStyle nameFormatStyle, NSPersonNameComponentsFormatterOptions nameOptions);
[Export ("stringFromPersonNameComponents:")]
string GetString (NSPersonNameComponents components);
[Export ("annotatedStringFromPersonNameComponents:")]
NSAttributedString GetAnnotatedString (NSPersonNameComponents components);
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject result, string str, out string errorDescription);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("personNameComponentsFromString:")]
[return: NullAllowed]
NSPersonNameComponents GetComponents (string @string);
}
[BaseType (typeof (NSObject))]
interface NSPipe {
[Export ("fileHandleForReading")]
NSFileHandle ReadHandle { get; }
[Export ("fileHandleForWriting")]
NSFileHandle WriteHandle { get; }
[Static]
[Export ("pipe")]
NSPipe Create ();
}
[BaseType (typeof (NSObject))]
interface NSFormatter : NSCoding, NSCopying {
[Export ("stringForObjectValue:")]
string StringFor ([NullAllowed] NSObject value);
// - (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs;
[Export ("editingStringForObjectValue:")]
string EditingStringFor (NSObject value);
[Internal]
[Sealed]
[Export ("attributedStringForObjectValue:withDefaultAttributes:")]
NSAttributedString GetAttributedString (NSObject obj, NSDictionary defaultAttributes);
// -(NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs;
[Export ("attributedStringForObjectValue:withDefaultAttributes:")]
NSAttributedString GetAttributedString (NSObject obj, NSDictionary<NSString, NSObject> defaultAttributes);
[Wrap ("GetAttributedString (obj, defaultAttributes.GetDictionary ()!)")]
#if MONOMAC
NSAttributedString GetAttributedString (NSObject obj, NSStringAttributes defaultAttributes);
#else
NSAttributedString GetAttributedString (NSObject obj, UIStringAttributes defaultAttributes);
#endif
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject obj, string str, out NSString error);
[Export ("isPartialStringValid:newEditingString:errorDescription:")]
bool IsPartialStringValid (string partialString, out string newString, out NSString error);
[Export ("isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:")]
bool IsPartialStringValid (ref string partialString, out NSRange proposedSelRange, string origString, NSRange origSelRange, out string error);
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSCoding {
// [Abstract]
[Export ("initWithCoder:")]
NativeHandle Constructor (NSCoder decoder);
[Abstract]
[Export ("encodeWithCoder:")]
void EncodeTo (NSCoder encoder);
}
[Protocol]
interface NSSecureCoding : NSCoding {
// note: +supportsSecureCoding being static it is not a good "generated" binding candidate
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSCopying {
[Abstract]
[return: Release]
[Export ("copyWithZone:")]
NSObject Copy ([NullAllowed] NSZone zone);
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSMutableCopying : NSCopying {
[Abstract]
[Export ("mutableCopyWithZone:")]
[return: Release ()]
NSObject MutableCopy ([NullAllowed] NSZone zone);
}
interface INSMutableCopying {}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSKeyedArchiverDelegate {
[Export ("archiver:didEncodeObject:"), EventArgs ("NSObject")]
void EncodedObject (NSKeyedArchiver archiver, NSObject obj);
[Export ("archiverDidFinish:")]
void Finished (NSKeyedArchiver archiver);
[Export ("archiver:willEncodeObject:"), DelegateName ("NSEncodeHook"), DefaultValue (null)]
NSObject WillEncode (NSKeyedArchiver archiver, NSObject obj);
[Export ("archiverWillFinish:")]
void Finishing (NSKeyedArchiver archiver);
[Export ("archiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
void ReplacingObject (NSKeyedArchiver archiver, NSObject oldObject, NSObject newObject);
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSKeyedUnarchiverDelegate {
[Export ("unarchiver:didDecodeObject:"), DelegateName ("NSDecoderCallback"), DefaultValue (null)]
NSObject DecodedObject (NSKeyedUnarchiver unarchiver, NSObject obj);
[Export ("unarchiverDidFinish:")]
void Finished (NSKeyedUnarchiver unarchiver);
[Export ("unarchiver:cannotDecodeObjectOfClassName:originalClasses:"), DelegateName ("NSDecoderHandler"), DefaultValue (null)]
Class CannotDecodeClass (NSKeyedUnarchiver unarchiver, string klass, string [] classes);
[Export ("unarchiverWillFinish:")]
void Finishing (NSKeyedUnarchiver unarchiver);
[Export ("unarchiver:willReplaceObject:withObject:"), EventArgs ("NSArchiveReplace")]
void ReplacingObject (NSKeyedUnarchiver unarchiver, NSObject oldObject, NSObject newObject);
}
[BaseType (typeof (NSCoder),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] { typeof (NSKeyedArchiverDelegate) })]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedArchiver init]: cannot use -init for initialization
[DisableDefaultCtor]
interface NSKeyedArchiver {
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("initRequiringSecureCoding:")]
NativeHandle Constructor (bool requiresSecureCoding);
// hack so we can decorate the default .ctor with availability attributes
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
[Export ("init")]
NativeHandle Constructor ();
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'NSKeyedArchiver (bool)' instead.")]
[Export ("initForWritingWithMutableData:")]
NativeHandle Constructor (NSMutableData data);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("archivedDataWithRootObject:requiringSecureCoding:error:")]
[return: NullAllowed]
#if NET
NSData GetArchivedData (NSObject @object, bool requiresSecureCoding, [NullAllowed] out NSError error);
#else
NSData ArchivedDataWithRootObject (NSObject @object, bool requiresSecureCoding, [NullAllowed] out NSError error);
#endif
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Export ("archivedDataWithRootObject:")]
[Static]
#if NET
NSData GetArchivedData (NSObject root);
#else
NSData ArchivedDataWithRootObject (NSObject root);
#endif
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'ArchivedDataWithRootObject (NSObject, bool, out NSError)' instead.")]
[Export ("archiveRootObject:toFile:")]
[Static]
bool ArchiveRootObjectToFile (NSObject root, string file);
[Export ("finishEncoding")]
void FinishEncoding ();
[Export ("outputFormat")]
NSPropertyListFormat PropertyListFormat { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSKeyedArchiverDelegate Delegate { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Export ("setClassName:forClass:")]
void SetClassName (string name, Class kls);
[Export ("classNameForClass:")]
string GetClassName (Class kls);
[iOS (7,0), Mac (10, 9)]
[Field ("NSKeyedArchiveRootObjectKey")]
NSString RootObjectKey { get; }
#if NET
[Export ("requiresSecureCoding")]
bool RequiresSecureCoding { get; set; }
#else
[Export ("setRequiresSecureCoding:")]
void SetRequiresSecureCoding (bool requireSecureEncoding);
[Export ("requiresSecureCoding")]
bool GetRequiresSecureCoding ();
#endif
[Watch (3,0)][TV (10,0)][Mac (10, 12)][iOS (10,0)]
[Export ("encodedData", ArgumentSemantic.Strong)]
NSData EncodedData { get; }
}
[BaseType (typeof (NSCoder),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] { typeof (NSKeyedUnarchiverDelegate) })]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[NSKeyedUnarchiver init]: cannot use -init for initialization
[DisableDefaultCtor]
interface NSKeyedUnarchiver {
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("initForReadingFromData:error:")]
NativeHandle Constructor (NSData data, [NullAllowed] out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("unarchivedObjectOfClass:fromData:error:")]
[return: NullAllowed]
NSObject GetUnarchivedObject (Class cls, NSData data, [NullAllowed] out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Wrap ("GetUnarchivedObject (new Class (type), data, out error)")]
[return: NullAllowed]
NSObject GetUnarchivedObject (Type type, NSData data, [NullAllowed] out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("unarchivedObjectOfClasses:fromData:error:")]
[return: NullAllowed]
NSObject GetUnarchivedObject (NSSet<Class> classes, NSData data, [NullAllowed] out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Wrap ("GetUnarchivedObject (new NSSet<Class> (Array.ConvertAll (types, t => new Class (t))), data, out error)")]
[return: NullAllowed]
NSObject GetUnarchivedObject (Type [] types, NSData data, [NullAllowed] out NSError error);
[Export ("initForReadingWithData:")]
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'NSKeyedUnarchiver (NSData, out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'NSKeyedUnarchiver (NSData, out NSError)' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'NSKeyedUnarchiver (NSData, out NSError)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'NSKeyedUnarchiver (NSData, out NSError)' instead.")]
[MarshalNativeExceptions]
NativeHandle Constructor (NSData data);
[Static, Export ("unarchiveObjectWithData:")]
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'GetUnarchivedObject ()' instead.")]
[MarshalNativeExceptions]
NSObject UnarchiveObject (NSData data);
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'GetUnarchivedObject ()' instead.")]
[Static, Export ("unarchiveTopLevelObjectWithData:error:")]
[iOS (9,0), Mac(10,11)]
// FIXME: [MarshalNativeExceptions]
NSObject UnarchiveTopLevelObject (NSData data, out NSError error);
[Static, Export ("unarchiveObjectWithFile:")]
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'GetUnarchivedObject ()' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'GetUnarchivedObject ()' instead.")]
[MarshalNativeExceptions]
NSObject UnarchiveFile (string file);
[Export ("finishDecoding")]
void FinishDecoding ();
[Wrap ("WeakDelegate")]
[Protocolize]
NSKeyedUnarchiverDelegate Delegate { get; set; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Export ("setClass:forClassName:")]
void SetClass (Class kls, string codedName);
[Export ("classForClassName:")]
[return: NullAllowed]
Class GetClass (string codedName);
#if NET
[Export ("requiresSecureCoding")]
bool RequiresSecureCoding { get; set; }
#else
[Export ("setRequiresSecureCoding:")]
void SetRequiresSecureCoding (bool requireSecureEncoding);
[Export ("requiresSecureCoding")]
bool GetRequiresSecureCoding ();
#endif
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Static]
[Export ("unarchivedArrayOfObjectsOfClass:fromData:error:")]
[return: NullAllowed]
NSObject[] GetUnarchivedArray (Class @class, NSData data, [NullAllowed] out NSError error);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Static]
[Export ("unarchivedArrayOfObjectsOfClasses:fromData:error:")]
[return: NullAllowed]
NSObject[] GetUnarchivedArray (NSSet<Class> classes, NSData data, [NullAllowed] out NSError error);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Static]
[Export ("unarchivedDictionaryWithKeysOfClass:objectsOfClass:fromData:error:")]
[return: NullAllowed]
NSDictionary GetUnarchivedDictionary (Class keyClass, Class valueClass, NSData data, [NullAllowed] out NSError error);
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Static]
[Export ("unarchivedDictionaryWithKeysOfClasses:objectsOfClasses:fromData:error:")]
[return: NullAllowed]
NSDictionary GetUnarchivedDictionary (NSSet<Class> keyClasses, NSSet<Class> valueClasses, NSData data, [NullAllowed] out NSError error);
}
[BaseType (typeof (NSObject), Delegates=new string [] { "Delegate" }, Events=new Type [] { typeof (NSMetadataQueryDelegate)})]
interface NSMetadataQuery {
[Export ("startQuery")]
bool StartQuery ();
[Export ("stopQuery")]
void StopQuery ();
[Export ("isStarted")]
bool IsStarted { get; }
[Export ("isGathering")]
bool IsGathering { get; }
[Export ("isStopped")]
bool IsStopped { get; }
[Export ("disableUpdates")]
void DisableUpdates ();
[Export ("enableUpdates")]
void EnableUpdates ();
[Export ("resultCount")]
nint ResultCount { get; }
[Export ("resultAtIndex:")]
NSObject ResultAtIndex (nint idx);
[Export ("results")]
NSMetadataItem[] Results { get; }
[Export ("indexOfResult:")]
nint IndexOfResult (NSObject result);
[Export ("valueLists")]
NSDictionary ValueLists { get; }
[Export ("groupedResults")]
NSObject [] GroupedResults { get; }
[Export ("valueOfAttribute:forResultAtIndex:")]
NSObject ValueOfAttribute (string attribyteName, nint atIndex);
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSMetadataQueryDelegate Delegate { get; set; }
[Export ("predicate", ArgumentSemantic.Copy)]
[NullAllowed] // by default this property is null
NSPredicate Predicate { get; set; }
[Export ("sortDescriptors", ArgumentSemantic.Copy)]
NSSortDescriptor[] SortDescriptors { get; set; }
[Export ("valueListAttributes", ArgumentSemantic.Copy)]
NSObject[] ValueListAttributes { get; set; }
[Export ("groupingAttributes", ArgumentSemantic.Copy)]
NSArray GroupingAttributes { get; set; }
[Export ("notificationBatchingInterval")]
double NotificationBatchingInterval { get; set; }
[Export ("searchScopes", ArgumentSemantic.Copy)]
NSObject [] SearchScopes { get; set; }
// There is no info associated with these notifications
[Field ("NSMetadataQueryDidStartGatheringNotification")]
[Notification]
NSString DidStartGatheringNotification { get; }
[Field ("NSMetadataQueryGatheringProgressNotification")]
[Notification]
NSString GatheringProgressNotification { get; }
[Field ("NSMetadataQueryDidFinishGatheringNotification")]
[Notification]
NSString DidFinishGatheringNotification { get; }
[Field ("NSMetadataQueryDidUpdateNotification")]
[Notification]
NSString DidUpdateNotification { get; }
[Field ("NSMetadataQueryResultContentRelevanceAttribute")]
NSString ResultContentRelevanceAttribute { get; }
// Scope constants for defined search locations
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSMetadataQueryUserHomeScope")]
NSString UserHomeScope { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSMetadataQueryLocalComputerScope")]
NSString LocalComputerScope { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSMetadataQueryLocalDocumentsScope")]
NSString LocalDocumentsScope { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSMetadataQueryNetworkScope")]
NSString NetworkScope { get; }
[Field ("NSMetadataQueryUbiquitousDocumentsScope")]
NSString UbiquitousDocumentsScope { get; }
[Field ("NSMetadataQueryUbiquitousDataScope")]
NSString UbiquitousDataScope { get; }
[iOS(8,0),Mac(10,10)]
[Field ("NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope")]
NSString AccessibleUbiquitousExternalDocumentsScope { get; }
[Field ("NSMetadataItemFSNameKey")]
NSString ItemFSNameKey { get; }
[Field ("NSMetadataItemDisplayNameKey")]
NSString ItemDisplayNameKey { get; }
[Field ("NSMetadataItemURLKey")]
NSString ItemURLKey { get; }
[Field ("NSMetadataItemPathKey")]
NSString ItemPathKey { get; }
[Field ("NSMetadataItemFSSizeKey")]
NSString ItemFSSizeKey { get; }
[Field ("NSMetadataItemFSCreationDateKey")]
NSString ItemFSCreationDateKey { get; }
[Field ("NSMetadataItemFSContentChangeDateKey")]
NSString ItemFSContentChangeDateKey { get; }
[iOS(8,0),Mac(10,9)]
[Field ("NSMetadataItemContentTypeKey")]
NSString ContentTypeKey { get; }
[iOS(8,0),Mac(10,9)]
[Field ("NSMetadataItemContentTypeTreeKey")]
NSString ContentTypeTreeKey { get; }
[Field ("NSMetadataItemIsUbiquitousKey")]
NSString ItemIsUbiquitousKey { get; }
[Field ("NSMetadataUbiquitousItemHasUnresolvedConflictsKey")]
NSString UbiquitousItemHasUnresolvedConflictsKey { get; }
[Deprecated (PlatformName.iOS, 7, 0, message : "Use 'UbiquitousItemDownloadingStatusKey' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 9, message : "Use 'UbiquitousItemDownloadingStatusKey' instead.")]
[Field ("NSMetadataUbiquitousItemIsDownloadedKey")]
NSString UbiquitousItemIsDownloadedKey { get; }
[Field ("NSMetadataUbiquitousItemIsDownloadingKey")]
NSString UbiquitousItemIsDownloadingKey { get; }
[Field ("NSMetadataUbiquitousItemIsUploadedKey")]
NSString UbiquitousItemIsUploadedKey { get; }
[Field ("NSMetadataUbiquitousItemIsUploadingKey")]
NSString UbiquitousItemIsUploadingKey { get; }
[iOS (7,0)]
[Mac (10,9)]
[Field ("NSMetadataUbiquitousItemDownloadingStatusKey")]
NSString UbiquitousItemDownloadingStatusKey { get; }
[iOS (7,0)]
[Mac (10,9)]
[Field ("NSMetadataUbiquitousItemDownloadingErrorKey")]
NSString UbiquitousItemDownloadingErrorKey { get; }
[iOS (7,0)]
[Mac (10,9)]
[Field ("NSMetadataUbiquitousItemUploadingErrorKey")]
NSString UbiquitousItemUploadingErrorKey { get; }
[Field ("NSMetadataUbiquitousItemPercentDownloadedKey")]
NSString UbiquitousItemPercentDownloadedKey { get; }
[Field ("NSMetadataUbiquitousItemPercentUploadedKey")]
NSString UbiquitousItemPercentUploadedKey { get; }
[iOS(8,0),Mac(10,10)]
[Field ("NSMetadataUbiquitousItemDownloadRequestedKey")]
NSString UbiquitousItemDownloadRequestedKey { get; }
[iOS(8,0),Mac(10,10)]
[Field ("NSMetadataUbiquitousItemIsExternalDocumentKey")]
NSString UbiquitousItemIsExternalDocumentKey { get; }
[iOS(8,0),Mac(10,10)]
[Field ("NSMetadataUbiquitousItemContainerDisplayNameKey")]
NSString UbiquitousItemContainerDisplayNameKey { get; }
[iOS(8,0),Mac(10,10)]
[Field ("NSMetadataUbiquitousItemURLInLocalContainerKey")]
NSString UbiquitousItemURLInLocalContainerKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemKeywordsKey")]
NSString KeywordsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTitleKey")]
NSString TitleKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAuthorsKey")]
NSString AuthorsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemEditorsKey")]
NSString EditorsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemParticipantsKey")]
NSString ParticipantsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemProjectsKey")]
NSString ProjectsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDownloadedDateKey")]
NSString DownloadedDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemWhereFromsKey")]
NSString WhereFromsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCommentKey")]
NSString CommentKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCopyrightKey")]
NSString CopyrightKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLastUsedDateKey")]
NSString LastUsedDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemContentCreationDateKey")]
NSString ContentCreationDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemContentModificationDateKey")]
NSString ContentModificationDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDateAddedKey")]
NSString DateAddedKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDurationSecondsKey")]
NSString DurationSecondsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemContactKeywordsKey")]
NSString ContactKeywordsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemVersionKey")]
NSString VersionKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPixelHeightKey")]
NSString PixelHeightKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPixelWidthKey")]
NSString PixelWidthKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPixelCountKey")]
NSString PixelCountKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemColorSpaceKey")]
NSString ColorSpaceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemBitsPerSampleKey")]
NSString BitsPerSampleKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFlashOnOffKey")]
NSString FlashOnOffKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFocalLengthKey")]
NSString FocalLengthKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAcquisitionMakeKey")]
NSString AcquisitionMakeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAcquisitionModelKey")]
NSString AcquisitionModelKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemISOSpeedKey")]
NSString IsoSpeedKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemOrientationKey")]
NSString OrientationKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLayerNamesKey")]
NSString LayerNamesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemWhiteBalanceKey")]
NSString WhiteBalanceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemApertureKey")]
NSString ApertureKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemProfileNameKey")]
NSString ProfileNameKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemResolutionWidthDPIKey")]
NSString ResolutionWidthDpiKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemResolutionHeightDPIKey")]
NSString ResolutionHeightDpiKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExposureModeKey")]
NSString ExposureModeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExposureTimeSecondsKey")]
NSString ExposureTimeSecondsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemEXIFVersionKey")]
NSString ExifVersionKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCameraOwnerKey")]
NSString CameraOwnerKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFocalLength35mmKey")]
NSString FocalLength35mmKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLensModelKey")]
NSString LensModelKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemEXIFGPSVersionKey")]
NSString ExifGpsVersionKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAltitudeKey")]
NSString AltitudeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLatitudeKey")]
NSString LatitudeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLongitudeKey")]
NSString LongitudeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemSpeedKey")]
NSString SpeedKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTimestampKey")]
NSString TimestampKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSTrackKey")]
NSString GpsTrackKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemImageDirectionKey")]
NSString ImageDirectionKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemNamedLocationKey")]
NSString NamedLocationKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSStatusKey")]
NSString GpsStatusKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSMeasureModeKey")]
NSString GpsMeasureModeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDOPKey")]
NSString GpsDopKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSMapDatumKey")]
NSString GpsMapDatumKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDestLatitudeKey")]
NSString GpsDestLatitudeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDestLongitudeKey")]
NSString GpsDestLongitudeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDestBearingKey")]
NSString GpsDestBearingKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDestDistanceKey")]
NSString GpsDestDistanceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSProcessingMethodKey")]
NSString GpsProcessingMethodKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSAreaInformationKey")]
NSString GpsAreaInformationKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDateStampKey")]
NSString GpsDateStampKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGPSDifferentalKey")]
NSString GpsDifferentalKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCodecsKey")]
NSString CodecsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMediaTypesKey")]
NSString MediaTypesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemStreamableKey")]
NSString StreamableKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTotalBitRateKey")]
NSString TotalBitRateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemVideoBitRateKey")]
NSString VideoBitRateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudioBitRateKey")]
NSString AudioBitRateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDeliveryTypeKey")]
NSString DeliveryTypeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAlbumKey")]
NSString AlbumKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemHasAlphaChannelKey")]
NSString HasAlphaChannelKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRedEyeOnOffKey")]
NSString RedEyeOnOffKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMeteringModeKey")]
NSString MeteringModeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMaxApertureKey")]
NSString MaxApertureKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFNumberKey")]
NSString FNumberKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExposureProgramKey")]
NSString ExposureProgramKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExposureTimeStringKey")]
NSString ExposureTimeStringKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemHeadlineKey")]
NSString HeadlineKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemInstructionsKey")]
NSString InstructionsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCityKey")]
NSString CityKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemStateOrProvinceKey")]
NSString StateOrProvinceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCountryKey")]
NSString CountryKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTextContentKey")]
NSString TextContentKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudioSampleRateKey")]
NSString AudioSampleRateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudioChannelCountKey")]
NSString AudioChannelCountKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTempoKey")]
NSString TempoKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemKeySignatureKey")]
NSString KeySignatureKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemTimeSignatureKey")]
NSString TimeSignatureKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudioEncodingApplicationKey")]
NSString AudioEncodingApplicationKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemComposerKey")]
NSString ComposerKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLyricistKey")]
NSString LyricistKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudioTrackNumberKey")]
NSString AudioTrackNumberKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRecordingDateKey")]
NSString RecordingDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMusicalGenreKey")]
NSString MusicalGenreKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemIsGeneralMIDISequenceKey")]
NSString IsGeneralMidiSequenceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRecordingYearKey")]
NSString RecordingYearKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemOrganizationsKey")]
NSString OrganizationsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemLanguagesKey")]
NSString LanguagesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRightsKey")]
NSString RightsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPublishersKey")]
NSString PublishersKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemContributorsKey")]
NSString ContributorsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCoverageKey")]
NSString CoverageKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemSubjectKey")]
NSString SubjectKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemThemeKey")]
NSString ThemeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDescriptionKey")]
NSString DescriptionKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemIdentifierKey")]
NSString IdentifierKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAudiencesKey")]
NSString AudiencesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemNumberOfPagesKey")]
NSString NumberOfPagesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPageWidthKey")]
NSString PageWidthKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPageHeightKey")]
NSString PageHeightKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemSecurityMethodKey")]
NSString SecurityMethodKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCreatorKey")]
NSString CreatorKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemEncodingApplicationsKey")]
NSString EncodingApplicationsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDueDateKey")]
NSString DueDateKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemStarRatingKey")]
NSString StarRatingKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPhoneNumbersKey")]
NSString PhoneNumbersKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemEmailAddressesKey")]
NSString EmailAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemInstantMessageAddressesKey")]
NSString InstantMessageAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemKindKey")]
NSString KindKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRecipientsKey")]
NSString RecipientsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFinderCommentKey")]
NSString FinderCommentKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemFontsKey")]
NSString FontsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAppleLoopsRootKeyKey")]
NSString AppleLoopsRootKeyKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAppleLoopsKeyFilterTypeKey")]
NSString AppleLoopsKeyFilterTypeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAppleLoopsLoopModeKey")]
NSString AppleLoopsLoopModeKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAppleLoopDescriptorsKey")]
NSString AppleLoopDescriptorsKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMusicalInstrumentCategoryKey")]
NSString MusicalInstrumentCategoryKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemMusicalInstrumentNameKey")]
NSString MusicalInstrumentNameKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemCFBundleIdentifierKey")]
NSString CFBundleIdentifierKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemInformationKey")]
NSString InformationKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemDirectorKey")]
NSString DirectorKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemProducerKey")]
NSString ProducerKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemGenreKey")]
NSString GenreKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemPerformersKey")]
NSString PerformersKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemOriginalFormatKey")]
NSString OriginalFormatKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemOriginalSourceKey")]
NSString OriginalSourceKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAuthorEmailAddressesKey")]
NSString AuthorEmailAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRecipientEmailAddressesKey")]
NSString RecipientEmailAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemAuthorAddressesKey")]
NSString AuthorAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemRecipientAddressesKey")]
NSString RecipientAddressesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemIsLikelyJunkKey")]
NSString IsLikelyJunkKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExecutableArchitecturesKey")]
NSString ExecutableArchitecturesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemExecutablePlatformKey")]
NSString ExecutablePlatformKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemApplicationCategoriesKey")]
NSString ApplicationCategoriesKey { get; }
[NoWatch, NoTV, NoiOS, Mac (10, 9), NoMacCatalyst]
[Field ("NSMetadataItemIsApplicationManagedKey")]
NSString IsApplicationManagedKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousItemIsSharedKey")]
NSString UbiquitousItemIsSharedKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemCurrentUserRoleKey")]
NSString UbiquitousSharedItemCurrentUserRoleKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemCurrentUserPermissionsKey")]
NSString UbiquitousSharedItemCurrentUserPermissionsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemOwnerNameComponentsKey")]
NSString UbiquitousSharedItemOwnerNameComponentsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemMostRecentEditorNameComponentsKey")]
NSString UbiquitousSharedItemMostRecentEditorNameComponentsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemRoleOwner")]
NSString UbiquitousSharedItemRoleOwner { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemRoleParticipant")]
NSString UbiquitousSharedItemRoleParticipant { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemPermissionsReadOnly")]
NSString UbiquitousSharedItemPermissionsReadOnly { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSMetadataUbiquitousSharedItemPermissionsReadWrite")]
NSString UbiquitousSharedItemPermissionsReadWrite { get; }
[iOS (7,0), Mac (10, 9)]
[NullAllowed] // by default this property is null
[Export ("searchItems", ArgumentSemantic.Copy)]
// DOC: object is a mixture of NSString, NSMetadataItem, NSUrl
NSObject [] SearchItems { get; set; }
[iOS (7,0), Mac (10, 9)]
[NullAllowed] // by default this property is null
[Export ("operationQueue", ArgumentSemantic.Retain)]
NSOperationQueue OperationQueue { get; set; }
[iOS (7,0), Mac (10, 9)]
[Export ("enumerateResultsUsingBlock:")]
void EnumerateResultsUsingBlock (NSMetadataQueryEnumerationCallback callback);
[iOS (7,0), Mac (10, 9), Export ("enumerateResultsWithOptions:usingBlock:")]
void EnumerateResultsWithOptions (NSEnumerationOptions opts, NSMetadataQueryEnumerationCallback block);
//
// These are for NSMetadataQueryDidUpdateNotification
//
[Mac (10,9)][iOS (8,0)]
[Field ("NSMetadataQueryUpdateAddedItemsKey")]
NSString QueryUpdateAddedItemsKey { get; }
[Mac (10,9)][iOS (8,0)]
[Field ("NSMetadataQueryUpdateChangedItemsKey")]
NSString QueryUpdateChangedItemsKey { get; }
[Mac (10,9)][iOS (8,0)]
[Field ("NSMetadataQueryUpdateRemovedItemsKey")]
NSString QueryUpdateRemovedItemsKey { get; }
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSMetadataQueryDelegate {
[Export ("metadataQuery:replacementObjectForResultObject:"), DelegateName ("NSMetadataQueryObject"), DefaultValue(null)]
NSObject ReplacementObjectForResultObject (NSMetadataQuery query, NSMetadataItem result);
[Export ("metadataQuery:replacementValueForAttribute:value:"), DelegateName ("NSMetadataQueryValue"), DefaultValue(null)]
NSObject ReplacementValueForAttributevalue (NSMetadataQuery query, string attributeName, NSObject value);
}
[BaseType (typeof (NSObject))]
#if NET
[DisableDefaultCtor] // points to nothing so access properties crash the apps
#endif
interface NSMetadataItem {
[NoiOS][NoTV][NoWatch]
[Mac (10,9)]
[DesignatedInitializer]
[Export ("initWithURL:")]
NativeHandle Constructor (NSUrl url);
[Export ("valueForAttribute:")]
NSObject ValueForAttribute (string key);
[Sealed]
[Internal]
[Export ("valueForAttribute:")]
IntPtr GetHandle (NSString key);
[Export ("valuesForAttributes:")]
NSDictionary ValuesForAttributes (NSArray keys);
[Export ("attributes")]
NSObject [] Attributes { get; }
}
[BaseType (typeof (NSObject))]
interface NSMetadataQueryAttributeValueTuple {
[Export ("attribute")]
string Attribute { get; }
[Export ("value")]
NSObject Value { get; }
[Export ("count")]
nint Count { get; }
}
[BaseType (typeof (NSObject))]
interface NSMetadataQueryResultGroup {
[Export ("attribute")]
string Attribute { get; }
[Export ("value")]
NSObject Value { get; }
[Export ("subgroups")]
NSObject [] Subgroups { get; }
[Export ("resultCount")]
nint ResultCount { get; }
[Export ("resultAtIndex:")]
NSObject ResultAtIndex (nuint idx);
[Export ("results")]
NSObject [] Results { get; }
}
// Sadly, while this API is a poor API and we should in general not use it
// Apple has now surfaced it on a few methods. So we need to take the Obsolete
// out, and we will have to fully support it.
[BaseType (typeof (NSArray))]
[DesignatedDefaultCtor]
interface NSMutableArray {
[DesignatedInitializer]
[Export ("initWithCapacity:")]
NativeHandle Constructor (nuint capacity);
[Internal]
[Sealed]
[Export ("addObject:")]
void _Add (IntPtr obj);
[Export ("addObject:")]
void Add (NSObject obj);
[Internal]
[Sealed]
[Export ("insertObject:atIndex:")]
void _Insert (IntPtr obj, nint index);
[Export ("insertObject:atIndex:")]
void Insert (NSObject obj, nint index);
[Export ("removeLastObject")]
void RemoveLastObject ();
[Export ("removeObjectAtIndex:")]
void RemoveObject (nint index);
[Internal]
[Sealed]
[Export ("replaceObjectAtIndex:withObject:")]
void _ReplaceObject (nint index, IntPtr withObject);
[Export ("replaceObjectAtIndex:withObject:")]
void ReplaceObject (nint index, NSObject withObject);
[Export ("removeAllObjects")]
void RemoveAllObjects ();
[Export ("addObjectsFromArray:")]
void AddObjects (NSObject [] source);
[Internal]
[Sealed]
[Export ("insertObjects:atIndexes:")]
void _InsertObjects (IntPtr objects, NSIndexSet atIndexes);
[Export ("insertObjects:atIndexes:")]
void InsertObjects (NSObject [] objects, NSIndexSet atIndexes);
[Export ("removeObjectsAtIndexes:")]
void RemoveObjectsAtIndexes (NSIndexSet indexSet);
[iOS (8,0), Mac(10,10)]
[Static, Export ("arrayWithContentsOfFile:")]
NSMutableArray FromFile (string path);
[iOS (8,0), Mac(10,10)]
[Static, Export ("arrayWithContentsOfURL:")]
NSMutableArray FromUrl (NSUrl url);
}
interface NSMutableArray<TValue> : NSMutableArray {}
[BaseType (typeof (NSAttributedString))]
interface NSMutableAttributedString {
[Export ("initWithString:")]
NativeHandle Constructor (string str);
[Export ("initWithString:attributes:")]
NativeHandle Constructor (string str, [NullAllowed] NSDictionary attributes);
[Export ("initWithAttributedString:")]
NativeHandle Constructor (NSAttributedString other);
[Export ("replaceCharactersInRange:withString:")]
void Replace (NSRange range, string newValue);
[Export ("setAttributes:range:")]
void LowLevelSetAttributes (IntPtr dictionaryAttrsHandle, NSRange range);
[Export ("mutableString", ArgumentSemantic.Retain)]
NSMutableString MutableString { get; }
[Export ("addAttribute:value:range:")]
void AddAttribute (NSString attributeName, NSObject value, NSRange range);
[Export ("addAttributes:range:")]
void AddAttributes (NSDictionary attrs, NSRange range);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("AddAttributes (attributes.GetDictionary ()!, range)")]
void AddAttributes (NSStringAttributes attributes, NSRange range);
[Export ("removeAttribute:range:")]
void RemoveAttribute (string name, NSRange range);
[Export ("replaceCharactersInRange:withAttributedString:")]
void Replace (NSRange range, NSAttributedString value);
[Export ("insertAttributedString:atIndex:")]
void Insert (NSAttributedString attrString, nint location);
[Export ("appendAttributedString:")]
void Append (NSAttributedString attrString);
[Export ("deleteCharactersInRange:")]
void DeleteRange (NSRange range);
[Export ("setAttributedString:")]
void SetString (NSAttributedString attrString);
[Export ("beginEditing")]
void BeginEditing ();
[Export ("endEditing")]
void EndEditing ();
[NoMac]
[NoTV]
[iOS (7,0)]
[Deprecated (PlatformName.iOS, 9, 0, message: "Use 'ReadFromUrl' instead.")]
[Export ("readFromFileURL:options:documentAttributes:error:")]
bool ReadFromFile (NSUrl url, NSDictionary options, ref NSDictionary returnOptions, ref NSError error);
[NoMac]
[NoTV]
[Deprecated (PlatformName.iOS, 9, 0, message: "Use 'ReadFromUrl' instead.")]
[Wrap ("ReadFromFile (url, options.GetDictionary ()!, ref returnOptions, ref error)")]
bool ReadFromFile (NSUrl url, NSAttributedStringDocumentAttributes options, ref NSDictionary returnOptions, ref NSError error);
[NoMac]
[iOS (7,0)]
[Export ("readFromData:options:documentAttributes:error:")]
bool ReadFromData (NSData data, NSDictionary options, ref NSDictionary returnOptions, ref NSError error);
[NoMac]
[Wrap ("ReadFromData (data, options.GetDictionary ()!, ref returnOptions, ref error)")]
bool ReadFromData (NSData data, NSAttributedStringDocumentAttributes options, ref NSDictionary returnOptions, ref NSError error);
[Internal]
[Sealed]
[iOS(9,0), Mac(10,11)]
[Export ("readFromURL:options:documentAttributes:error:")]
bool ReadFromUrl (NSUrl url, NSDictionary options, ref NSDictionary<NSString, NSObject> returnOptions, ref NSError error);
[iOS(9,0), Mac(10,11)]
[Export ("readFromURL:options:documentAttributes:error:")]
bool ReadFromUrl (NSUrl url, NSDictionary<NSString, NSObject> options, ref NSDictionary<NSString, NSObject> returnOptions, ref NSError error);
[iOS(9,0), Mac(10,11)]
[Wrap ("ReadFromUrl (url, options.GetDictionary ()!, ref returnOptions, ref error)")]
bool ReadFromUrl (NSUrl url, NSAttributedStringDocumentAttributes options, ref NSDictionary<NSString, NSObject> returnOptions, ref NSError error);
}
[BaseType (typeof (NSData))]
interface NSMutableData {
[Static, Export ("dataWithCapacity:")] [Autorelease]
[PreSnippet ("if (capacity < 0 || capacity > nint.MaxValue) throw new ArgumentOutOfRangeException ();", Optimizable = true)]
NSMutableData FromCapacity (nint capacity);
[Static, Export ("dataWithLength:")] [Autorelease]
[PreSnippet ("if (length < 0 || length > nint.MaxValue) throw new ArgumentOutOfRangeException ();", Optimizable = true)]
NSMutableData FromLength (nint length);
[Static, Export ("data")] [Autorelease]
NSMutableData Create ();
[Export ("mutableBytes")]
IntPtr MutableBytes { get; }
[Export ("initWithCapacity:")]
[PreSnippet ("if (capacity > (ulong) nint.MaxValue) throw new ArgumentOutOfRangeException ();", Optimizable = true)]
NativeHandle Constructor (nuint capacity);
[Export ("appendData:")]
void AppendData (NSData other);
[Export ("appendBytes:length:")]
void AppendBytes (IntPtr bytes, nuint len);
[Export ("setData:")]
void SetData (NSData data);
[Export ("length")]
[Override]
nuint Length { get; set; }
[Export ("replaceBytesInRange:withBytes:")]
void ReplaceBytes (NSRange range, IntPtr buffer);
[Export ("resetBytesInRange:")]
void ResetBytes (NSRange range);
[Export ("replaceBytesInRange:withBytes:length:")]
void ReplaceBytes (NSRange range, IntPtr buffer, nuint length);
// NSMutableDataCompression (NSMutableData)
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("decompressUsingAlgorithm:error:")]
bool Decompress (NSDataCompressionAlgorithm algorithm, [NullAllowed] out NSError error);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("compressUsingAlgorithm:error:")]
bool Compress (NSDataCompressionAlgorithm algorithm, [NullAllowed] out NSError error);
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSDataCompressionAlgorithm : long {
Lzfse = 0,
Lz4,
Lzma,
Zlib,
}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSDate : NSSecureCoding, NSCopying, CKRecordValue {
[Export ("timeIntervalSinceReferenceDate")]
double SecondsSinceReferenceDate { get; }
[Export ("timeIntervalSinceDate:")]
double GetSecondsSince (NSDate anotherDate);
[Export ("timeIntervalSinceNow")]
double SecondsSinceNow { get; }
[Export ("timeIntervalSince1970")]
double SecondsSince1970 { get; }
[Export ("dateWithTimeIntervalSinceReferenceDate:")]
[Static]
NSDate FromTimeIntervalSinceReferenceDate (double secs);
[Static, Export ("dateWithTimeIntervalSince1970:")]
NSDate FromTimeIntervalSince1970 (double secs);
[Export ("date")]
[Static]
NSDate Now { get; }
[Export ("distantPast")]
[Static]
NSDate DistantPast { get; }
[Export ("distantFuture")]
[Static]
NSDate DistantFuture { get; }
[Export ("dateByAddingTimeInterval:")]
NSDate AddSeconds (double seconds);
[Export ("dateWithTimeIntervalSinceNow:")]
[Static]
NSDate FromTimeIntervalSinceNow (double secs);
[Export ("descriptionWithLocale:")]
string DescriptionWithLocale (NSLocale locale);
[Export ("earlierDate:")]
NSDate EarlierDate (NSDate anotherDate);
[Export ("laterDate:")]
NSDate LaterDate (NSDate anotherDate);
[Export ("compare:")]
NSComparisonResult Compare (NSDate other);
[Export ("isEqualToDate:")]
bool IsEqualToDate (NSDate other);
// NSDate_SensorKit
[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Static]
[Export ("dateWithSRAbsoluteTime:")]
NSDate CreateFromSRAbsoluteTime (double time);
[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Export ("initWithSRAbsoluteTime:")]
NativeHandle Constructor (double srAbsoluteTime);
[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Export ("srAbsoluteTime")]
double SrAbsoluteTime { get; }
}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSDictionary : NSSecureCoding, NSMutableCopying, NSFetchRequestResult, INSFastEnumeration {
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'NSMutableDictionary.FromFile' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'NSMutableDictionary.FromFile' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'NSMutableDictionary.FromFile' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'NSMutableDictionary.FromFile' instead.")]
[Export ("dictionaryWithContentsOfFile:")]
[Static]
NSDictionary FromFile (string path);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'NSMutableDictionary.FromUrl' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'NSMutableDictionary.FromUrl' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'NSMutableDictionary.FromUrl' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'NSMutableDictionary.FromUrl' instead.")]
[Export ("dictionaryWithContentsOfURL:")]
[Static]
NSDictionary FromUrl (NSUrl url);
[Export ("dictionaryWithObject:forKey:")]
[Static]
NSDictionary FromObjectAndKey (NSObject obj, NSObject key);
[Export ("dictionaryWithDictionary:")]
[Static]
NSDictionary FromDictionary (NSDictionary source);
[Export ("dictionaryWithObjects:forKeys:count:")]
[Static, Internal]
IntPtr _FromObjectsAndKeysInternal (IntPtr objects, IntPtr keys, nint count);
[Export ("dictionaryWithObjects:forKeys:count:")]
[Static, Internal]
NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys, nint count);
[Export ("dictionaryWithObjects:forKeys:")]
[Static, Internal]
IntPtr _FromObjectsAndKeysInternal (IntPtr objects, IntPtr keys);
[Export ("dictionaryWithObjects:forKeys:")]
[Static, Internal]
NSDictionary FromObjectsAndKeysInternal ([NullAllowed] NSArray objects, [NullAllowed] NSArray keys);
[Export ("initWithDictionary:")]
NativeHandle Constructor (NSDictionary other);
[Export ("initWithDictionary:copyItems:")]
NativeHandle Constructor (NSDictionary other, bool copyItems);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'NSMutableDictionary(string)' constructor instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'NSMutableDictionary(string)' constructor instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'NSMutableDictionary(string)' constructor instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'NSMutableDictionary(string)' constructor instead.")]
[Export ("initWithContentsOfFile:")]
NativeHandle Constructor (string fileName);
[Export ("initWithObjects:forKeys:"), Internal]
NativeHandle Constructor (NSArray objects, NSArray keys);
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'NSMutableDictionary(NSUrl)' constructor instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'NSMutableDictionary(NSUrl)' constructor instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'NSMutableDictionary(NSUrl)' constructor instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'NSMutableDictionary(NSUrl)' constructor instead.")]
[Export ("initWithContentsOfURL:")]
NativeHandle Constructor (NSUrl url);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("initWithContentsOfURL:error:")]
NativeHandle Constructor (NSUrl url, out NSError error);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("dictionaryWithContentsOfURL:error:")]
[return: NullAllowed]
NSDictionary<NSString, NSObject> FromUrl (NSUrl url, out NSError error);
[Export ("count")]
nuint Count { get; }
[Internal]
[Sealed]
[Export ("objectForKey:")]
IntPtr _ObjectForKey (IntPtr key);
[Export ("objectForKey:")]
NSObject ObjectForKey (NSObject key);
[Internal]
[Sealed]
[Export ("allKeys")]
IntPtr _AllKeys ();
[Export ("allKeys")][Autorelease]
NSObject [] Keys { get; }
[Internal]
[Sealed]
[Export ("allKeysForObject:")]
IntPtr _AllKeysForObject (IntPtr obj);
[Export ("allKeysForObject:")][Autorelease]
NSObject [] KeysForObject (NSObject obj);
[Internal]
[Sealed]
[Export ("allValues")]
IntPtr _AllValues ();
[Export ("allValues")][Autorelease]
NSObject [] Values { get; }
[Export ("descriptionInStringsFileFormat")]
string DescriptionInStringsFileFormat { get; }
[Export ("isEqualToDictionary:")]
bool IsEqualToDictionary (NSDictionary other);
[Export ("objectEnumerator")]
NSEnumerator ObjectEnumerator { get; }
[Internal]
[Sealed]
[Export ("objectsForKeys:notFoundMarker:")]
IntPtr _ObjectsForKeys (IntPtr keys, IntPtr marker);
[Export ("objectsForKeys:notFoundMarker:")][Autorelease]
NSObject [] ObjectsForKeys (NSArray keys, NSObject marker);
[Deprecated (PlatformName.MacOSX, 10,15)]
[Deprecated (PlatformName.iOS, 13,0)]
[Deprecated (PlatformName.WatchOS, 6,0)]
[Deprecated (PlatformName.TvOS, 13,0)]
[Export ("writeToFile:atomically:")]
bool WriteToFile (string path, bool useAuxiliaryFile);
[Deprecated (PlatformName.MacOSX, 10,15)]
[Deprecated (PlatformName.iOS, 13,0)]
[Deprecated (PlatformName.WatchOS, 6,0)]
[Deprecated (PlatformName.TvOS, 13,0)]
[Export ("writeToURL:atomically:")]
bool WriteToUrl (NSUrl url, bool atomically);
[Static]
[Export ("sharedKeySetForKeys:")]
NSObject GetSharedKeySetForKeys (NSObject [] keys);
}
interface NSDictionary<K,V> : NSDictionary {}
[BaseType (typeof (NSObject))]
interface NSEnumerator {
[Export ("nextObject")]
NSObject NextObject ();
}
interface NSEnumerator<T> : NSEnumerator {}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSError : NSSecureCoding, NSCopying {
[Static, Export ("errorWithDomain:code:userInfo:")]
NSError FromDomain (NSString domain, nint code, [NullAllowed] NSDictionary userInfo);
[DesignatedInitializer]
[Export ("initWithDomain:code:userInfo:")]
NativeHandle Constructor (NSString domain, nint code, [NullAllowed] NSDictionary userInfo);
[Export ("domain")]
string Domain { get; }
[Export ("code")]
nint Code { get; }
[Export ("userInfo")]
NSDictionary UserInfo { get; }
[Export ("localizedDescription")]
string LocalizedDescription { get; }
[Export ("localizedFailureReason")]
string LocalizedFailureReason { get; }
[Export ("localizedRecoverySuggestion")]
string LocalizedRecoverySuggestion { get; }
[Export ("localizedRecoveryOptions")]
string [] LocalizedRecoveryOptions { get; }
[Export ("helpAnchor")]
string HelpAnchor { get; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[MacCatalyst (14,5)]
[Export ("underlyingErrors", ArgumentSemantic.Copy)]
NSError [] UnderlyingErrors { get; }
[Field ("NSCocoaErrorDomain")]
NSString CocoaErrorDomain { get;}
[Field ("NSPOSIXErrorDomain")]
NSString PosixErrorDomain { get; }
[Field ("NSOSStatusErrorDomain")]
NSString OsStatusErrorDomain { get; }
[Field ("NSMachErrorDomain")]
NSString MachErrorDomain { get; }
[Field ("NSURLErrorDomain")]
NSString NSUrlErrorDomain { get; }
#if NET
[NoWatch]
#else
[Obsoleted (PlatformName.WatchOS, 7,0)]
#endif
[Field ("NSNetServicesErrorDomain")]
NSString NSNetServicesErrorDomain { get; }
[Field ("NSStreamSocketSSLErrorDomain")]
NSString NSStreamSocketSSLErrorDomain { get; }
[Field ("NSStreamSOCKSErrorDomain")]
NSString NSStreamSOCKSErrorDomain { get; }
[Field ("kCLErrorDomain", "CoreLocation")]
NSString CoreLocationErrorDomain { get; }
#if !WATCH
[Field ("kCFErrorDomainCFNetwork", "CFNetwork")]
NSString CFNetworkErrorDomain { get; }
#endif
[NoMac, NoTV]
[Field ("CMErrorDomain", "CoreMotion")]
NSString CoreMotionErrorDomain { get; }
#if !XAMCORE_3_0
// now exposed with the corresponding EABluetoothAccessoryPickerError enum
[NoMac, NoTV, NoWatch]
[Field ("EABluetoothAccessoryPickerErrorDomain", "ExternalAccessory")]
NSString EABluetoothAccessoryPickerErrorDomain { get; }
// now exposed with the corresponding MKErrorCode enum
[TV (9,2)]
[NoMac][NoWatch]
[Field ("MKErrorDomain", "MapKit")]
NSString MapKitErrorDomain { get; }
// now exposed with the corresponding WKErrorCode enum
[NoMac, NoTV]
[iOS (8,2)]
[Unavailable (PlatformName.iOS)]
[Field ("WatchKitErrorDomain", "WatchKit")]
NSString WatchKitErrorDomain { get; }
#endif
[Field ("NSUnderlyingErrorKey")]
NSString UnderlyingErrorKey { get; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[MacCatalyst (14,5)]
[Field ("NSMultipleUnderlyingErrorsKey")]
NSString MultipleUnderlyingErrorsKey { get; }
[Field ("NSLocalizedDescriptionKey")]
NSString LocalizedDescriptionKey { get; }
[Field ("NSLocalizedFailureReasonErrorKey")]
NSString LocalizedFailureReasonErrorKey { get; }
[Field ("NSLocalizedRecoverySuggestionErrorKey")]
NSString LocalizedRecoverySuggestionErrorKey { get; }
[Field ("NSLocalizedRecoveryOptionsErrorKey")]
NSString LocalizedRecoveryOptionsErrorKey { get; }
[Field ("NSRecoveryAttempterErrorKey")]
NSString RecoveryAttempterErrorKey { get; }
[Field ("NSHelpAnchorErrorKey")]
NSString HelpAnchorErrorKey { get; }
[Field ("NSStringEncodingErrorKey")]
NSString StringEncodingErrorKey { get; }
[Field ("NSURLErrorKey")]
NSString UrlErrorKey { get; }
[Field ("NSFilePathErrorKey")]
NSString FilePathErrorKey { get; }
[iOS (9,0)][Mac (10,11)]
[Field ("NSDebugDescriptionErrorKey")]
NSString DebugDescriptionErrorKey { get; }
[iOS (11,0), Mac (10,13), Watch (4,0), TV (11,0)]
[Field ("NSLocalizedFailureErrorKey")]
NSString LocalizedFailureErrorKey { get; }
[iOS (9,0)][Mac (10,11)]
[Static]
[Export ("setUserInfoValueProviderForDomain:provider:")]
void SetUserInfoValueProvider (string errorDomain, [NullAllowed] NSErrorUserInfoValueProvider provider);
[iOS (9,0)][Mac (10,11)]
[Static]
[Export ("userInfoValueProviderForDomain:")]
[return: NullAllowed]
NSErrorUserInfoValueProvider GetUserInfoValueProvider (string errorDomain);
// From NSError (NSFileProviderError) Category to avoid static category uglyness
[iOS (11,0)]
[Mac (10,15)]
[NoMacCatalyst][NoTV][NoWatch]
[Static]
[Export ("fileProviderErrorForCollisionWithItem:")]
NSError GetFileProviderError (INSFileProviderItem existingItem);
[iOS (11,0)]
[Mac (10,15)]
[NoMacCatalyst][NoTV][NoWatch]
[Static]
[Export ("fileProviderErrorForNonExistentItemWithIdentifier:")]
NSError GetFileProviderError (string nonExistentItemIdentifier);
[NoiOS]
[Mac (11,0)]
[NoMacCatalyst][NoTV][NoWatch]
[Static]
[Export ("fileProviderErrorForRejectedDeletionOfItem:")]
NSError GetFileProviderErrorForRejectedDeletion (INSFileProviderItem updatedVersion);
#if false
// FIXME that value is present in the header (7.0 DP 6) files but returns NULL (i.e. unusable)
// we're also missing other NSURLError* fields (which we should add)
[iOS (7,0)]
[Field ("NSURLErrorBackgroundTaskCancelledReasonKey")]
NSString NSUrlErrorBackgroundTaskCancelledReasonKey { get; }
#endif
}
delegate NSObject NSErrorUserInfoValueProvider (NSError error, NSString userInfoKey);
[BaseType (typeof (NSObject))]
// 'init' returns NIL
[DisableDefaultCtor]
interface NSException : NSSecureCoding, NSCopying {
[DesignatedInitializer]
[Export ("initWithName:reason:userInfo:")]
NativeHandle Constructor (string name, string reason, [NullAllowed] NSDictionary userInfo);
[Export ("name")]
string Name { get; }
[Export ("reason")]
string Reason { get; }
[Export ("userInfo")]
NSObject UserInfo { get; }
[Export ("callStackReturnAddresses")]
NSNumber[] CallStackReturnAddresses { get; }
[Export ("callStackSymbols")]
string[] CallStackSymbols { get; }
}
#if !NET && !WATCH
[Obsolete("NSExpressionHandler is deprecated, please use FromFormat (string, NSObject[]) instead.")]
delegate void NSExpressionHandler (NSObject evaluatedObject, NSExpression [] expressions, NSMutableDictionary context);
#endif
delegate NSObject NSExpressionCallbackHandler (NSObject evaluatedObject, NSExpression [] expressions, NSMutableDictionary context);
[BaseType (typeof (NSObject))]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -predicateFormat cannot be sent to an abstract object of class NSExpression: Create a concrete instance!
[DisableDefaultCtor]
interface NSExpression : NSSecureCoding, NSCopying {
[Static, Export ("expressionForConstantValue:")]
NSExpression FromConstant ([NullAllowed] NSObject obj);
[Static, Export ("expressionForEvaluatedObject")]
NSExpression ExpressionForEvaluatedObject { get; }
[Static, Export ("expressionForVariable:")]
NSExpression FromVariable (string string1);
[Static, Export ("expressionForKeyPath:")]
NSExpression FromKeyPath (string keyPath);
[Static, Export ("expressionForFunction:arguments:")]
NSExpression FromFunction (string name, NSExpression[] parameters);
[Static, Export ("expressionWithFormat:")]
NSExpression FromFormat (string expressionFormat);
#if !NET && !WATCH
[Obsolete("Use 'FromFormat (string, NSObject[])' instead.")]
[Static, Export ("expressionWithFormat:argumentArray:")]
NSExpression FromFormat (string format, NSExpression [] parameters);
#endif
[Static, Export ("expressionWithFormat:argumentArray:")]
NSExpression FromFormat (string format, NSObject [] parameters);
//+ (NSExpression *)expressionForAggregate:(NSArray *)subexpressions;
[Static, Export ("expressionForAggregate:")]
NSExpression FromAggregate (NSExpression [] subexpressions);
[Static, Export ("expressionForUnionSet:with:")]
NSExpression FromUnionSet (NSExpression left, NSExpression right);
[Static, Export ("expressionForIntersectSet:with:")]
NSExpression FromIntersectSet (NSExpression left, NSExpression right);
[Static, Export ("expressionForMinusSet:with:")]
NSExpression FromMinusSet (NSExpression left, NSExpression right);
//+ (NSExpression *)expressionForSubquery:(NSExpression *)expression usingIteratorVariable:(NSString *)variable predicate:(id)predicate;
[Static, Export ("expressionForSubquery:usingIteratorVariable:predicate:")]
NSExpression FromSubquery (NSExpression expression, string variable, NSObject predicate);
[Static, Export ("expressionForFunction:selectorName:arguments:")]
NSExpression FromFunction (NSExpression target, string name, NSExpression[] parameters);
#if !NET && !WATCH
[Obsolete("Use 'FromFunction (NSExpressionCallbackHandler, NSExpression[])' instead.")]
[Static, Export ("expressionForBlock:arguments:")]
NSExpression FromFunction (NSExpressionHandler target, NSExpression[] parameters);
#endif
[Static, Export ("expressionForBlock:arguments:")]
NSExpression FromFunction (NSExpressionCallbackHandler target, NSExpression[] parameters);
[iOS (7,0), Mac (10, 9)]
[Static]
[Export ("expressionForAnyKey")]
NSExpression FromAnyKey ();
[iOS(9,0),Mac(10,11)]
[Static]
[Export ("expressionForConditional:trueExpression:falseExpression:")]
NSExpression FromConditional (NSPredicate predicate, NSExpression trueExpression, NSExpression falseExpression);
[iOS (7,0), Mac (10, 9)]
[Export ("allowEvaluation")]
void AllowEvaluation ();
[DesignatedInitializer]
[Export ("initWithExpressionType:")]
NativeHandle Constructor (NSExpressionType type);
[Export ("expressionType")]
NSExpressionType ExpressionType { get; }
[Sealed, Internal, Export ("expressionBlock")]
NSExpressionCallbackHandler _Block { get; }
[Sealed, Internal, Export ("constantValue")]
NSObject _ConstantValue { get; }
[Sealed, Internal, Export ("keyPath")]
string _KeyPath { get; }
[Sealed, Internal, Export ("function")]
string _Function { get; }
[Sealed, Internal, Export ("variable")]
string _Variable { get; }
[Sealed, Internal, Export ("operand")]
NSExpression _Operand { get; }
[Sealed, Internal, Export ("arguments")]
NSExpression[] _Arguments { get; }
[Sealed, Internal, Export ("collection")]
NSObject _Collection { get; }
[Sealed, Internal, Export ("predicate")]
NSPredicate _Predicate { get; }
[Sealed, Internal, Export ("leftExpression")]
NSExpression _LeftExpression { get; }
[Sealed, Internal, Export ("rightExpression")]
NSExpression _RightExpression { get; }
[Mac(10,11),iOS(9,0)]
[Sealed, Internal, Export ("trueExpression")]
NSExpression _TrueExpression { get; }
[Mac(10,11),iOS(9,0)]
[Sealed, Internal, Export ("falseExpression")]
NSExpression _FalseExpression { get; }
[Export ("expressionValueWithObject:context:")]
[return: NullAllowed]
NSObject EvaluateWith ([NullAllowed] NSObject obj, [NullAllowed] NSMutableDictionary context);
}
[iOS (8,0)][Mac (10,10)] // Not defined in 32-bit
[BaseType (typeof (NSObject))]
partial interface NSExtensionContext {
[Export ("inputItems", ArgumentSemantic.Copy)]
NSExtensionItem [] InputItems { get; }
[Async]
[Export ("completeRequestReturningItems:completionHandler:")]
void CompleteRequest (NSExtensionItem [] returningItems, [NullAllowed] Action<bool> completionHandler);
[Export ("cancelRequestWithError:")]
void CancelRequest (NSError error);
[Export ("openURL:completionHandler:")]
[Async]
void OpenUrl (NSUrl url, [NullAllowed] Action<bool> completionHandler);
[Field ("NSExtensionItemsAndErrorsKey")]
NSString ItemsAndErrorsKey { get; }
[NoMac]
[iOS (8,2)]
[Notification]
[Field ("NSExtensionHostWillEnterForegroundNotification")]
NSString HostWillEnterForegroundNotification { get; }
[NoMac]
[iOS (8,2)]
[Notification]
[Field ("NSExtensionHostDidEnterBackgroundNotification")]
NSString HostDidEnterBackgroundNotification { get; }
[NoMac]
[iOS (8,2)]
[Notification]
[Field ("NSExtensionHostWillResignActiveNotification")]
NSString HostWillResignActiveNotification { get; }
[NoMac]
[iOS (8,2)]
[Notification]
[Field ("NSExtensionHostDidBecomeActiveNotification")]
NSString HostDidBecomeActiveNotification { get; }
}
[iOS (8,0)][Mac (10,10)] // Not defined in 32-bit
[BaseType (typeof (NSObject))]
partial interface NSExtensionItem : NSCopying, NSSecureCoding {
[NullAllowed] // by default this property is null
[Export ("attributedTitle", ArgumentSemantic.Copy)]
NSAttributedString AttributedTitle { get; set; }
[NullAllowed] // by default this property is null
[Export ("attributedContentText", ArgumentSemantic.Copy)]
NSAttributedString AttributedContentText { get; set; }
[NullAllowed] // by default this property is null
[Export ("attachments", ArgumentSemantic.Copy)]
NSItemProvider [] Attachments { get; set; }
[Export ("userInfo", ArgumentSemantic.Copy)]
NSDictionary UserInfo { get; set; }
[Field ("NSExtensionItemAttributedTitleKey")]
NSString AttributedTitleKey { get; }
[Field ("NSExtensionItemAttributedContentTextKey")]
NSString AttributedContentTextKey { get; }
[Field ("NSExtensionItemAttachmentsKey")]
NSString AttachmentsKey { get; }
}
[BaseType (typeof (NSObject))]
interface NSNull : NSSecureCoding, NSCopying
#if !WATCH
, CAAction
#endif
{
[Export ("null"), Static]
[Internal]
NSNull _Null { get; }
}
[iOS (8,0)]
[Mac(10,10)]
[BaseType (typeof (NSFormatter))]
interface NSLengthFormatter {
[Export ("numberFormatter", ArgumentSemantic.Copy)]
NSNumberFormatter NumberFormatter { get; set; }
[Export ("unitStyle")]
NSFormattingUnitStyle UnitStyle { get; set; }
[Export ("stringFromValue:unit:")]
string StringFromValue (double value, NSLengthFormatterUnit unit);
[Export ("stringFromMeters:")]
string StringFromMeters (double numberInMeters);
[Export ("unitStringFromValue:unit:")]
string UnitStringFromValue (double value, NSLengthFormatterUnit unit);
[Export ("unitStringFromMeters:usedUnit:")]
string UnitStringFromMeters (double numberInMeters, ref NSLengthFormatterUnit unitp);
[Export ("getObjectValue:forString:errorDescription:")]
bool GetObjectValue (out NSObject obj, string str, out string error);
[Export ("forPersonHeightUse")]
bool ForPersonHeightUse { [Bind ("isForPersonHeightUse")] get; set; }
}
delegate void NSLingusticEnumerator (NSString tag, NSRange tokenRange, NSRange sentenceRange, ref bool stop);
[Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'NaturalLanguage.*' API instead.")]
[Deprecated (PlatformName.iOS, 14,0, message: "Use 'NaturalLanguage.*' API instead.")]
[Deprecated (PlatformName.WatchOS, 7,0, message: "Use 'NaturalLanguage.*' API instead.")]
[Deprecated (PlatformName.TvOS, 14,0, message: "Use 'NaturalLanguage.*' API instead.")]
[BaseType (typeof (NSObject))]
interface NSLinguisticTagger {
[DesignatedInitializer]
[Export ("initWithTagSchemes:options:")]
NativeHandle Constructor (NSString [] tagSchemes, NSLinguisticTaggerOptions opts);
[Export ("tagSchemes")]
NSString [] TagSchemes { get; }
[Static]
[Export ("availableTagSchemesForLanguage:")]
NSString [] GetAvailableTagSchemesForLanguage (string language);
[Export ("setOrthography:range:")]
void SetOrthographyrange (NSOrthography orthography, NSRange range);
[Export ("orthographyAtIndex:effectiveRange:")]
NSOrthography GetOrthography (nint charIndex, ref NSRange effectiveRange);
[Export ("stringEditedInRange:changeInLength:")]
void StringEditedInRange (NSRange newRange, nint delta);
[Export ("enumerateTagsInRange:scheme:options:usingBlock:")]
void EnumerateTagsInRange (NSRange range, NSString tagScheme, NSLinguisticTaggerOptions opts, NSLingusticEnumerator enumerator);
[Export ("sentenceRangeForRange:")]
NSRange GetSentenceRangeForRange (NSRange range);
[Export ("tagAtIndex:scheme:tokenRange:sentenceRange:")]
string GetTag (nint charIndex, NSString tagScheme, ref NSRange tokenRange, ref NSRange sentenceRange);
[Export ("tagsInRange:scheme:options:tokenRanges:"), Internal]
NSString [] GetTagsInRange (NSRange range, NSString tagScheme, NSLinguisticTaggerOptions opts, ref NSArray tokenRanges);
[Export ("possibleTagsAtIndex:scheme:tokenRange:sentenceRange:scores:"), Internal]
NSString [] GetPossibleTags (nint charIndex, NSString tagScheme, ref NSRange tokenRange, ref NSRange sentenceRange, ref NSArray scores);
//Detected properties
[NullAllowed] // by default this property is null
[Export ("string", ArgumentSemantic.Retain)]
string AnalysisString { get; set; }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("tagsInRange:unit:scheme:options:tokenRanges:")]
string[] GetTags (NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] out NSValue[] tokenRanges);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("enumerateTagsInRange:unit:scheme:options:usingBlock:")]
void EnumerateTags (NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, LinguisticTagEnumerator enumerator);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("tagAtIndex:unit:scheme:tokenRange:")]
[return: NullAllowed]
string GetTag (nuint charIndex, NSLinguisticTaggerUnit unit, string scheme, [NullAllowed] ref NSRange tokenRange);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("tokenRangeAtIndex:unit:")]
NSRange GetTokenRange (nuint charIndex, NSLinguisticTaggerUnit unit);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("availableTagSchemesForUnit:language:")]
string[] GetAvailableTagSchemes (NSLinguisticTaggerUnit unit, string language);
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("dominantLanguage")]
string DominantLanguage { get; }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("dominantLanguageForString:")]
[return: NullAllowed]
string GetDominantLanguage (string str);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("tagForString:atIndex:unit:scheme:orthography:tokenRange:")]
[return: NullAllowed]
string GetTag (string str, nuint charIndex, NSLinguisticTaggerUnit unit, string scheme, [NullAllowed] NSOrthography orthography, [NullAllowed] ref NSRange tokenRange);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("tagsForString:range:unit:scheme:options:orthography:tokenRanges:")]
string[] GetTags (string str, NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, [NullAllowed] out NSValue[] tokenRanges);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("enumerateTagsForString:range:unit:scheme:options:orthography:usingBlock:")]
void EnumerateTags (string str, NSRange range, NSLinguisticTaggerUnit unit, string scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, LinguisticTagEnumerator enumerator);
}
delegate void LinguisticTagEnumerator (string tag, NSRange tokenRange, bool stop);
#if !NET
[Obsolete ("Use 'NSLinguisticTagUnit' enum instead.")]
[Static]
interface NSLinguisticTag {
[Field ("NSLinguisticTagSchemeTokenType")]
NSString SchemeTokenType { get; }
[Field ("NSLinguisticTagSchemeLexicalClass")]
NSString SchemeLexicalClass { get; }
[Field ("NSLinguisticTagSchemeNameType")]
NSString SchemeNameType { get; }
[Field ("NSLinguisticTagSchemeNameTypeOrLexicalClass")]
NSString SchemeNameTypeOrLexicalClass { get; }
[Field ("NSLinguisticTagSchemeLemma")]
NSString SchemeLemma { get; }
[Field ("NSLinguisticTagSchemeLanguage")]
NSString SchemeLanguage { get; }
[Field ("NSLinguisticTagSchemeScript")]
NSString SchemeScript { get; }
[Field ("NSLinguisticTagWord")]
NSString Word { get; }
[Field ("NSLinguisticTagPunctuation")]
NSString Punctuation { get; }
[Field ("NSLinguisticTagWhitespace")]
NSString Whitespace { get; }
[Field ("NSLinguisticTagOther")]
NSString Other { get; }
[Field ("NSLinguisticTagNoun")]
NSString Noun { get; }
[Field ("NSLinguisticTagVerb")]
NSString Verb { get; }
[Field ("NSLinguisticTagAdjective")]
NSString Adjective { get; }
[Field ("NSLinguisticTagAdverb")]
NSString Adverb { get; }
[Field ("NSLinguisticTagPronoun")]
NSString Pronoun { get; }
[Field ("NSLinguisticTagDeterminer")]
NSString Determiner { get; }
[Field ("NSLinguisticTagParticle")]
NSString Particle { get; }
[Field ("NSLinguisticTagPreposition")]
NSString Preposition { get; }
[Field ("NSLinguisticTagNumber")]
NSString Number { get; }
[Field ("NSLinguisticTagConjunction")]
NSString Conjunction { get; }
[Field ("NSLinguisticTagInterjection")]
NSString Interjection { get; }
[Field ("NSLinguisticTagClassifier")]
NSString Classifier { get; }
[Field ("NSLinguisticTagIdiom")]
NSString Idiom { get; }
[Field ("NSLinguisticTagOtherWord")]
NSString OtherWord { get; }
[Field ("NSLinguisticTagSentenceTerminator")]
NSString SentenceTerminator { get; }
[Field ("NSLinguisticTagOpenQuote")]
NSString OpenQuote { get; }
[Field ("NSLinguisticTagCloseQuote")]
NSString CloseQuote { get; }
[Field ("NSLinguisticTagOpenParenthesis")]
NSString OpenParenthesis { get; }
[Field ("NSLinguisticTagCloseParenthesis")]
NSString CloseParenthesis { get; }
[Field ("NSLinguisticTagWordJoiner")]
NSString WordJoiner { get; }
[Field ("NSLinguisticTagDash")]
NSString Dash { get; }
[Field ("NSLinguisticTagOtherPunctuation")]
NSString OtherPunctuation { get; }
[Field ("NSLinguisticTagParagraphBreak")]
NSString ParagraphBreak { get; }
[Field ("NSLinguisticTagOtherWhitespace")]
NSString OtherWhitespace { get; }
[Field ("NSLinguisticTagPersonalName")]
NSString PersonalName { get; }
[Field ("NSLinguisticTagPlaceName")]
NSString PlaceName { get; }
[Field ("NSLinguisticTagOrganizationName")]
NSString OrganizationName { get; }
}
#endif
[BaseType (typeof (NSObject))]
// 'init' returns NIL so it's not usable evenif it does not throw an ObjC exception
// funnily it was "added" in iOS 7 and header files says "do not invoke; not a valid initializer for this class"
[DisableDefaultCtor]
interface NSLocale : NSSecureCoding, NSCopying {
[Static]
[Export ("systemLocale", ArgumentSemantic.Copy)]
NSLocale SystemLocale { get; }
[Static]
[Export ("currentLocale", ArgumentSemantic.Copy)]
NSLocale CurrentLocale { get; }
[Static]
[Export ("autoupdatingCurrentLocale", ArgumentSemantic.Strong)]
NSLocale AutoUpdatingCurrentLocale { get; }
[DesignatedInitializer]
[Export ("initWithLocaleIdentifier:")]
NativeHandle Constructor (string identifier);
[Export ("localeIdentifier")]
string LocaleIdentifier { get; }
[Export ("availableLocaleIdentifiers", ArgumentSemantic.Copy)][Static]
string [] AvailableLocaleIdentifiers { get; }
[Export ("ISOLanguageCodes", ArgumentSemantic.Copy)][Static]
string [] ISOLanguageCodes { get; }
[Export ("ISOCurrencyCodes", ArgumentSemantic.Copy)][Static]
string [] ISOCurrencyCodes { get; }
[Export ("ISOCountryCodes", ArgumentSemantic.Copy)][Static]
string [] ISOCountryCodes { get; }
[Export ("commonISOCurrencyCodes", ArgumentSemantic.Copy)][Static]
string [] CommonISOCurrencyCodes { get; }
[Export ("preferredLanguages", ArgumentSemantic.Copy)][Static]
string [] PreferredLanguages { get; }
[Export ("componentsFromLocaleIdentifier:")][Static]
NSDictionary ComponentsFromLocaleIdentifier (string identifier);
[Export ("localeIdentifierFromComponents:")][Static]
string LocaleIdentifierFromComponents (NSDictionary dict);
[Export ("canonicalLanguageIdentifierFromString:")][Static]
string CanonicalLanguageIdentifierFromString (string str);
[Export ("canonicalLocaleIdentifierFromString:")][Static]
string CanonicalLocaleIdentifierFromString (string str);
[Export ("characterDirectionForLanguage:")][Static]
NSLocaleLanguageDirection GetCharacterDirection (string isoLanguageCode);
[Export ("lineDirectionForLanguage:")][Static]
NSLocaleLanguageDirection GetLineDirection (string isoLanguageCode);
[iOS (7,0)] // already in OSX 10.6
[Static]
[Export ("localeWithLocaleIdentifier:")]
NSLocale FromLocaleIdentifier (string ident);
[Field ("NSCurrentLocaleDidChangeNotification")]
[Notification]
NSString CurrentLocaleDidChangeNotification { get; }
[Export ("objectForKey:"), Internal]
NSObject ObjectForKey (NSString key);
[Export ("displayNameForKey:value:"), Internal]
NSString DisplayNameForKey (NSString key, string value);
[Internal, Field ("NSLocaleIdentifier")]
NSString _Identifier { get; }
[Internal, Field ("NSLocaleLanguageCode")]
NSString _LanguageCode { get; }
[Internal, Field ("NSLocaleCountryCode")]
NSString _CountryCode { get; }
[Internal, Field ("NSLocaleScriptCode")]
NSString _ScriptCode { get; }
[Internal, Field ("NSLocaleVariantCode")]
NSString _VariantCode { get; }
[Internal, Field ("NSLocaleExemplarCharacterSet")]
NSString _ExemplarCharacterSet { get; }
[Internal, Field ("NSLocaleCalendar")]
NSString _Calendar { get; }
[Internal, Field ("NSLocaleCollationIdentifier")]
NSString _CollationIdentifier { get; }
[Internal, Field ("NSLocaleUsesMetricSystem")]
NSString _UsesMetricSystem { get; }
[Internal, Field ("NSLocaleMeasurementSystem")]
NSString _MeasurementSystem { get; }
[Internal, Field ("NSLocaleDecimalSeparator")]
NSString _DecimalSeparator { get; }
[Internal, Field ("NSLocaleGroupingSeparator")]
NSString _GroupingSeparator { get; }
[Internal, Field ("NSLocaleCurrencySymbol")]
NSString _CurrencySymbol { get; }
[Internal, Field ("NSLocaleCurrencyCode")]
NSString _CurrencyCode { get; }
[Internal, Field ("NSLocaleCollatorIdentifier")]
NSString _CollatorIdentifier { get; }
[Internal, Field ("NSLocaleQuotationBeginDelimiterKey")]
NSString _QuotationBeginDelimiterKey { get; }
[Internal, Field ("NSLocaleQuotationEndDelimiterKey")]
NSString _QuotationEndDelimiterKey { get; }
[Internal, Field ("NSLocaleAlternateQuotationBeginDelimiterKey")]
NSString _AlternateQuotationBeginDelimiterKey { get; }
[Internal, Field ("NSLocaleAlternateQuotationEndDelimiterKey")]
NSString _AlternateQuotationEndDelimiterKey { get; }
// follow the pattern of NSLocale.cs which included managed helpers that did the same
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Export ("calendarIdentifier")]
string CalendarIdentifier { get; }
[Watch (3,0), TV (10,0), Mac (10,12), iOS (10,0)]
[Export ("localizedStringForCalendarIdentifier:")]
[return: NullAllowed]
string GetLocalizedCalendarIdentifier (string calendarIdentifier);
}
delegate void NSMatchEnumerator (NSTextCheckingResult result, NSMatchingFlags flags, ref bool stop);
// This API surfaces NSString instead of strings, because we already have the .NET version that uses
// strings, so it makes sense to use NSString here (and also, the replacing functionality operates on
// NSMutableStrings)
[BaseType (typeof (NSObject))]
interface NSRegularExpression : NSCopying, NSSecureCoding {
[DesignatedInitializer]
[Export ("initWithPattern:options:error:")]
NativeHandle Constructor (NSString pattern, NSRegularExpressionOptions options, out NSError error);
[Static]
[Export ("regularExpressionWithPattern:options:error:")]
NSRegularExpression Create (NSString pattern, NSRegularExpressionOptions options, out NSError error);
[Export ("pattern")]
NSString Pattern { get; }
[Export ("options")]
NSRegularExpressionOptions Options { get; }
[Export ("numberOfCaptureGroups")]
nuint NumberOfCaptureGroups { get; }
[Export ("escapedPatternForString:")]
[Static]
NSString GetEscapedPattern (NSString str);
/* From the NSMatching category */
[Export ("enumerateMatchesInString:options:range:usingBlock:")]
void EnumerateMatches (NSString str, NSMatchingOptions options, NSRange range, NSMatchEnumerator enumerator);
#if !NET
[Obsolete ("Use 'GetMatches2' instead, this method has the wrong return type.")]
[Export ("matchesInString:options:range:")]
NSString [] GetMatches (NSString str, NSMatchingOptions options, NSRange range);
#endif
[Export ("matchesInString:options:range:")]
#if NET
NSTextCheckingResult [] GetMatches (NSString str, NSMatchingOptions options, NSRange range);
#else
[Sealed]
NSTextCheckingResult [] GetMatches2 (NSString str, NSMatchingOptions options, NSRange range);
#endif
[Export ("numberOfMatchesInString:options:range:")]
nuint GetNumberOfMatches (NSString str, NSMatchingOptions options, NSRange range);
[Export ("firstMatchInString:options:range:")]
[return: NullAllowed]
NSTextCheckingResult FindFirstMatch (string str, NSMatchingOptions options, NSRange range);
[Export ("rangeOfFirstMatchInString:options:range:")]
NSRange GetRangeOfFirstMatch (string str, NSMatchingOptions options, NSRange range);
/* From the NSReplacement category */
[Export ("stringByReplacingMatchesInString:options:range:withTemplate:")]
string ReplaceMatches (string sourceString, NSMatchingOptions options, NSRange range, string template);
[Export ("replaceMatchesInString:options:range:withTemplate:")]
nuint ReplaceMatches (NSMutableString mutableString, NSMatchingOptions options, NSRange range, NSString template);
[Export ("replacementStringForResult:inString:offset:template:")]
NSString GetReplacementString (NSTextCheckingResult result, NSString str, nint offset, NSString template);
[Static, Export ("escapedTemplateForString:")]
NSString GetEscapedTemplate (NSString str);
}
[BaseType (typeof (NSObject))]
// init returns NIL
[DisableDefaultCtor]
interface NSRunLoop {
[Export ("currentRunLoop", ArgumentSemantic.Strong)][Static][IsThreadStatic]
NSRunLoop Current { get; }
[Export ("mainRunLoop", ArgumentSemantic.Strong)][Static]
NSRunLoop Main { get; }
[Export ("currentMode")]
NSString CurrentMode { get; }
[Wrap ("NSRunLoopModeExtensions.GetValue (CurrentMode)")]
NSRunLoopMode CurrentRunLoopMode { get; }
[Export ("getCFRunLoop")]
CFRunLoop GetCFRunLoop ();
[Export ("addTimer:forMode:")]
void AddTimer (NSTimer timer, NSString forMode);
[Wrap ("AddTimer (timer, forMode.GetConstant ()!)")]
void AddTimer (NSTimer timer, NSRunLoopMode forMode);
[Export ("limitDateForMode:")]
NSDate LimitDateForMode (NSString mode);
[Wrap ("LimitDateForMode (mode.GetConstant ()!)")]
NSDate LimitDateForMode (NSRunLoopMode mode);
[Export ("acceptInputForMode:beforeDate:")]
void AcceptInputForMode (NSString mode, NSDate limitDate);
[Wrap ("AcceptInputForMode (mode.GetConstant ()!, limitDate)")]
void AcceptInputForMode (NSRunLoopMode mode, NSDate limitDate);
[Export ("run")]
void Run ();
[Export ("runUntilDate:")]
void RunUntil (NSDate date);
[Export ("runMode:beforeDate:")]
bool RunUntil (NSString runLoopMode, NSDate limitdate);
[Wrap ("RunUntil (runLoopMode.GetConstant ()!, limitDate)")]
bool RunUntil (NSRunLoopMode runLoopMode, NSDate limitDate);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("performBlock:")]
void Perform (Action block);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("performInModes:block:")]
void Perform (NSString[] modes, Action block);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Wrap ("Perform (modes.GetConstants ()!, block)")]
void Perform (NSRunLoopMode[] modes, Action block);
#if !NET
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[Field ("NSDefaultRunLoopMode")]
NSString NSDefaultRunLoopMode { get; }
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[Field ("NSRunLoopCommonModes")]
NSString NSRunLoopCommonModes { get; }
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[Deprecated (PlatformName.MacOSX, 10, 13, message: "Use 'NSXpcConnection' instead.")]
[NoiOS, NoWatch, NoTV]
[Field ("NSConnectionReplyMode")]
NSString NSRunLoopConnectionReplyMode { get; }
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[NoiOS, NoWatch, NoTV]
[Field ("NSModalPanelRunLoopMode", "AppKit")]
NSString NSRunLoopModalPanelMode { get; }
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[NoiOS, NoWatch, NoTV]
[Field ("NSEventTrackingRunLoopMode", "AppKit")]
NSString NSRunLoopEventTracking { get; }
[Obsolete ("Use the 'NSRunLoopMode' enum instead.")]
[NoMac][NoWatch]
[Field ("UITrackingRunLoopMode", "UIKit")]
NSString UITrackingRunLoopMode { get; }
#endif
}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSSet : NSSecureCoding, NSMutableCopying {
[Export ("set")][Static]
NSSet CreateSet ();
[Export ("initWithSet:")]
NativeHandle Constructor (NSSet other);
[Export ("initWithArray:")]
NativeHandle Constructor (NSArray other);
[Export ("count")]
nuint Count { get; }
[Internal]
[Sealed]
[Export ("member:")]
IntPtr _LookupMember (IntPtr probe);
[Export ("member:")]
NSObject LookupMember (NSObject probe);
[Internal]
[Sealed]
[Export ("anyObject")]
IntPtr _AnyObject { get; }
[Export ("anyObject")]
NSObject AnyObject { get; }
[Internal]
[Sealed]
[Export ("containsObject:")]
bool _Contains (NativeHandle id);
[Export ("containsObject:")]
bool Contains (NSObject id);
[Export ("allObjects")][Internal]
IntPtr _AllObjects ();
[Export ("isEqualToSet:")]
bool IsEqualToSet (NSSet other);
[Export ("objectEnumerator"), Internal]
NSEnumerator _GetEnumerator ();
[Export ("isSubsetOfSet:")]
bool IsSubsetOf (NSSet other);
[Export ("enumerateObjectsUsingBlock:")]
void Enumerate (NSSetEnumerator enumerator);
[Internal]
[Sealed]
[Export ("setByAddingObjectsFromSet:")]
NativeHandle _SetByAddingObjectsFromSet (NativeHandle other);
[Export ("setByAddingObjectsFromSet:"), Internal]
NSSet SetByAddingObjectsFromSet (NSSet other);
[Export ("intersectsSet:")]
bool IntersectsSet (NSSet other);
[Internal]
[Static]
[Export ("setWithArray:")]
NativeHandle _SetWithArray (NativeHandle array);
}
interface NSSet<TKey> : NSSet {}
[BaseType (typeof (NSObject))]
interface NSSortDescriptor : NSSecureCoding, NSCopying {
[Export ("initWithKey:ascending:")]
NativeHandle Constructor (string key, bool ascending);
[Export ("initWithKey:ascending:selector:")]
NativeHandle Constructor (string key, bool ascending, [NullAllowed] Selector selector);
[Export ("initWithKey:ascending:comparator:")]
NativeHandle Constructor (string key, bool ascending, NSComparator comparator);
[Export ("key")]
string Key { get; }
[Export ("ascending")]
bool Ascending { get; }
[NullAllowed]
[Export ("selector")]
Selector Selector { get; }
[Export ("compareObject:toObject:")]
NSComparisonResult Compare (NSObject object1, NSObject object2);
[Export ("reversedSortDescriptor")]
NSObject ReversedSortDescriptor { get; }
[iOS (7,0), Mac (10, 9)]
[Export ("allowEvaluation")]
void AllowEvaluation ();
}
[Category, BaseType (typeof (NSOrderedSet))]
partial interface NSKeyValueSorting_NSOrderedSet {
[Export ("sortedArrayUsingDescriptors:")]
NSObject [] GetSortedArray (NSSortDescriptor [] sortDescriptors);
}
#pragma warning disable 618
[Category, BaseType (typeof (NSMutableArray))]
#pragma warning restore 618
partial interface NSSortDescriptorSorting_NSMutableArray {
[Export ("sortUsingDescriptors:")]
void SortUsingDescriptors (NSSortDescriptor [] sortDescriptors);
}
[Category, BaseType (typeof (NSMutableOrderedSet))]
partial interface NSKeyValueSorting_NSMutableOrderedSet {
[Export ("sortUsingDescriptors:")]
void SortUsingDescriptors (NSSortDescriptor [] sortDescriptors);
}
[BaseType (typeof(NSObject))]
[Dispose ("if (disposing) { Invalidate (); } ", Optimizable = true)]
// init returns NIL
[DisableDefaultCtor]
interface NSTimer {
[Static, Export ("scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:")]
NSTimer CreateScheduledTimer (double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Static]
[Export ("scheduledTimerWithTimeInterval:repeats:block:")]
NSTimer CreateScheduledTimer (double interval, bool repeats, Action<NSTimer> block);
[Static, Export ("timerWithTimeInterval:target:selector:userInfo:repeats:")]
NSTimer CreateTimer (double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Static]
[Export ("timerWithTimeInterval:repeats:block:")]
NSTimer CreateTimer (double interval, bool repeats, Action<NSTimer> block);
[DesignatedInitializer]
[Export ("initWithFireDate:interval:target:selector:userInfo:repeats:")]
NativeHandle Constructor (NSDate date, double seconds, NSObject target, Selector selector, [NullAllowed] NSObject userInfo, bool repeats);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("initWithFireDate:interval:repeats:block:")]
NativeHandle Constructor (NSDate date, double seconds, bool repeats, Action<NSTimer> block);
[Export ("fire")]
void Fire ();
[NullAllowed] // by default this property is null
[Export ("fireDate", ArgumentSemantic.Copy)]
NSDate FireDate { get; set; }
// Note: preserving this member allows us to re-enable the `Optimizable` binding flag
[Preserve (Conditional = true)]
[Export ("invalidate")]
void Invalidate ();
[Export ("isValid")]
bool IsValid { get; }
[Export ("timeInterval")]
double TimeInterval { get; }
[Export ("userInfo")]
NSObject UserInfo { get; }
[iOS (7,0), Mac (10, 9)]
[Export ("tolerance")]
double Tolerance { get; set; }
}
[BaseType (typeof(NSObject))]
// NSTimeZone is an abstract class that defines the behavior of time zone objects. -> http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSTimeZone_Class/Reference/Reference.html
// calling 'init' returns a NIL pointer, i.e. an unusable instance
[DisableDefaultCtor]
interface NSTimeZone : NSSecureCoding, NSCopying {
[Export ("initWithName:")]
NativeHandle Constructor (string name);
[Export ("initWithName:data:")]
NativeHandle Constructor (string name, NSData data);
[Export ("name")]
string Name { get; }
[Export ("data")]
NSData Data { get; }
[Export ("secondsFromGMTForDate:")]
nint SecondsFromGMT (NSDate date);
[Static]
[Export ("abbreviationDictionary")]
NSDictionary Abbreviations { get; }
[Export ("abbreviation")]
string Abbreviation ();
[Export ("abbreviationForDate:")]
string Abbreviation (NSDate date);
[Export ("isDaylightSavingTimeForDate:")]
bool IsDaylightSavingsTime (NSDate date);
[Export ("daylightSavingTimeOffsetForDate:")]
double DaylightSavingTimeOffset (NSDate date);
[Export ("nextDaylightSavingTimeTransitionAfterDate:")]
NSDate NextDaylightSavingTimeTransitionAfter (NSDate date);
[Static, Export ("timeZoneWithName:")]
NSTimeZone FromName (string tzName);
[Static, Export ("timeZoneWithName:data:")]
NSTimeZone FromName (string tzName, NSData data);
[Static]
[Export ("timeZoneForSecondsFromGMT:")]
NSTimeZone FromGMT (nint seconds);
[Static, Export ("localTimeZone", ArgumentSemantic.Copy)]
NSTimeZone LocalTimeZone { get; }
[Export ("secondsFromGMT")]
nint GetSecondsFromGMT { get; }
[Export ("defaultTimeZone", ArgumentSemantic.Copy), Static]
NSTimeZone DefaultTimeZone { get; set; }
[Export ("resetSystemTimeZone"), Static]
void ResetSystemTimeZone ();
[Export ("systemTimeZone", ArgumentSemantic.Copy), Static]
NSTimeZone SystemTimeZone { get; }
[Export ("timeZoneWithAbbreviation:"), Static]
NSTimeZone FromAbbreviation (string abbreviation);
[Export ("knownTimeZoneNames"), Static, Internal]
string[] _KnownTimeZoneNames { get; }
[Export ("timeZoneDataVersion"), Static]
string DataVersion { get; }
[Export ("localizedName:locale:")]
string GetLocalizedName (NSTimeZoneNameStyle style, [NullAllowed] NSLocale locale);
}
interface NSUbiquitousKeyValueStoreChangeEventArgs {
[Export ("NSUbiquitousKeyValueStoreChangedKeysKey")]
string [] ChangedKeys { get; }
[Export ("NSUbiquitousKeyValueStoreChangeReasonKey")]
NSUbiquitousKeyValueStoreChangeReason ChangeReason { get; }
}
[BaseType (typeof (NSObject))]
#if WATCH
[Advice (Constants.UnavailableOnWatchOS)]
[DisableDefaultCtor] // "NSUbiquitousKeyValueStore is unavailable" is printed to the log.
#endif
interface NSUbiquitousKeyValueStore {
[Static]
[Export ("defaultStore")]
NSUbiquitousKeyValueStore DefaultStore { get; }
[Export ("objectForKey:"), Internal]
NSObject ObjectForKey (string aKey);
[Export ("setObject:forKey:"), Internal]
void SetObjectForKey (NSObject anObject, string aKey);
[Export ("removeObjectForKey:")]
void Remove (string aKey);
[Export ("stringForKey:")]
string GetString (string aKey);
[Export ("arrayForKey:")]
NSObject [] GetArray (string aKey);
[Export ("dictionaryForKey:")]
NSDictionary GetDictionary (string aKey);
[Export ("dataForKey:")]
NSData GetData (string aKey);
[Export ("longLongForKey:")]
long GetLong (string aKey);
[Export ("doubleForKey:")]
double GetDouble (string aKey);
[Export ("boolForKey:")]
bool GetBool (string aKey);
[Export ("setString:forKey:"), Internal]
void _SetString (string aString, string aKey);
[Export ("setData:forKey:"), Internal]
void _SetData (NSData data, string key);
[Export ("setArray:forKey:"), Internal]
void _SetArray (NSObject [] array, string key);
[Export ("setDictionary:forKey:"), Internal]
void _SetDictionary (NSDictionary aDictionary, string aKey);
[Export ("setLongLong:forKey:"), Internal]
void _SetLong (long value, string aKey);
[Export ("setDouble:forKey:"), Internal]
void _SetDouble (double value, string aKey);
[Export ("setBool:forKey:"), Internal]
void _SetBool (bool value, string aKey);
[Export ("dictionaryRepresentation")]
NSDictionary ToDictionary ();
[Export ("synchronize")]
bool Synchronize ();
[Field ("NSUbiquitousKeyValueStoreDidChangeExternallyNotification")]
[Notification (typeof (NSUbiquitousKeyValueStoreChangeEventArgs))]
NSString DidChangeExternallyNotification { get; }
[Field ("NSUbiquitousKeyValueStoreChangeReasonKey")]
NSString ChangeReasonKey { get; }
[Field ("NSUbiquitousKeyValueStoreChangedKeysKey")]
NSString ChangedKeysKey { get; }
}
[BaseType (typeof (NSObject), Name="NSUUID")]
[DesignatedDefaultCtor]
interface NSUuid : NSSecureCoding, NSCopying {
[Export ("initWithUUIDString:")]
NativeHandle Constructor (string str);
// bound manually to keep the managed/native signatures identical
//[Export ("initWithUUIDBytes:"), Internal]
//NativeHandle Constructor (IntPtr bytes, bool unused);
[Export ("getUUIDBytes:"), Internal]
void GetUuidBytes (IntPtr uuid);
[Export ("UUIDString")]
string AsString ();
}
[iOS (8,0)][Mac (10,10), Watch (2,0), TV (9,0)] // .objc_class_name_NSUserActivity", referenced from '' not found
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // xcode 8 beta 4 marks it as API_DEPRECATED
partial interface NSUserActivity
#if IOS // iOS only.
: NSItemProviderReading, NSItemProviderWriting
#endif
{
[DesignatedInitializer]
[Export ("initWithActivityType:")]
NativeHandle Constructor (string activityType);
[Export ("activityType")]
string ActivityType { get; }
[NullAllowed] // by default this property is null
[Export ("title")]
string Title { get; set; }
[Export ("userInfo", ArgumentSemantic.Copy), NullAllowed]
NSDictionary UserInfo { get; set; }
[Export ("needsSave")]
bool NeedsSave { get; set; }
[NullAllowed] // by default this property is null
[Export ("webpageURL", ArgumentSemantic.Copy)]
NSUrl WebPageUrl { get; set; }
[Export ("supportsContinuationStreams")]
bool SupportsContinuationStreams { get; set; }
[Export ("delegate", ArgumentSemantic.Weak), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSUserActivityDelegate Delegate { get; set; }
[Export ("addUserInfoEntriesFromDictionary:")]
void AddUserInfoEntries (NSDictionary otherDictionary);
[Export ("becomeCurrent")]
void BecomeCurrent ();
[Export ("invalidate")]
void Invalidate ();
[Export ("getContinuationStreamsWithCompletionHandler:")]
[Async (ResultTypeName="NSUserActivityContinuation")]
void GetContinuationStreams (Action<NSInputStream,NSOutputStream,NSError> completionHandler);
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("requiredUserInfoKeys", ArgumentSemantic.Copy)]
NSSet<NSString> RequiredUserInfoKeys { get; set; }
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("expirationDate", ArgumentSemantic.Copy)]
NSDate ExpirationDate { get; set; }
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("keywords", ArgumentSemantic.Copy)]
NSSet<NSString> Keywords { get; set; }
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("resignCurrent")]
void ResignCurrent ();
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("eligibleForHandoff")]
bool EligibleForHandoff { [Bind ("isEligibleForHandoff")] get; set; }
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("eligibleForSearch")]
bool EligibleForSearch { [Bind ("isEligibleForSearch")] get; set; }
[Mac(10,11), iOS (9,0), Watch (3,0), TV (10,0)]
[Export ("eligibleForPublicIndexing")]
bool EligibleForPublicIndexing { [Bind ("isEligibleForPublicIndexing")] get; set; }
[iOS (9,0)]
[Mac (10,13)]
[NoWatch][NoTV]
[NullAllowed]
[Export ("contentAttributeSet", ArgumentSemantic.Copy)] // From CSSearchableItemAttributeSet.h
CSSearchableItemAttributeSet ContentAttributeSet { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("referrerURL", ArgumentSemantic.Copy)]
NSUrl ReferrerUrl { get; set; }
// From NSUserActivity (CIBarcodeDescriptor)
[TV (11,3), Mac (10,13,4), iOS (11,3), NoWatch]
[NullAllowed, Export ("detectedBarcodeDescriptor", ArgumentSemantic.Copy)]
CIBarcodeDescriptor DetectedBarcodeDescriptor { get; }
// From NSUserActivity (CLSDeepLinks)
[Introduced (PlatformName.MacCatalyst, 14, 0)]
[NoWatch, NoTV, Mac (11, 0), iOS (11,4)]
[Export ("isClassKitDeepLink")]
bool IsClassKitDeepLink { get; }
[Introduced (PlatformName.MacCatalyst, 14, 0)]
[NoWatch, NoTV, Mac (11, 0), iOS (11,4)]
[NullAllowed, Export ("contextIdentifierPath", ArgumentSemantic.Strong)]
string[] ContextIdentifierPath { get; }
// From NSUserActivity (IntentsAdditions)
[Watch (5,0), NoTV, Mac (12,0), iOS (12,0)]
[NullAllowed, Export ("suggestedInvocationPhrase")]
string SuggestedInvocationPhrase {
// This _simply_ ensure that the Intents namespace (via the enum) will be present which,
// in turns, means that the Intents.framework is loaded into memory and this makes the
// selectors (getter and setter) work at runtime. Other selectors do not need it.
// reference: https://github.com/xamarin/xamarin-macios/issues/4894
[PreSnippet ("GC.KeepAlive (Intents.INCallCapabilityOptions.AudioCall); // no-op to ensure Intents.framework is loaded into memory", Optimizable = true)]
get;
[PreSnippet ("GC.KeepAlive (Intents.INCallCapabilityOptions.AudioCall); // no-op to ensure Intents.framework is loaded into memory", Optimizable = true)]
set;
}
[Watch (5, 0), NoTV, NoMac, iOS (12, 0)]
[Export ("eligibleForPrediction")]
bool EligibleForPrediction { [Bind ("isEligibleForPrediction")] get; set; }
[Watch (5, 0), NoTV, iOS (12, 0)]
[Mac (10,15)]
[NullAllowed, Export ("persistentIdentifier")]
string PersistentIdentifier { get; set; }
[Watch (5,0), NoTV, iOS (12,0)]
[Mac (10,15)]
[Static]
[Async]
[Export ("deleteSavedUserActivitiesWithPersistentIdentifiers:completionHandler:")]
void DeleteSavedUserActivities (string[] persistentIdentifiers, Action handler);
[Watch (5,0), NoTV, iOS (12,0)]
[Mac (10,15)]
[Static]
[Async]
[Export ("deleteAllSavedUserActivitiesWithCompletionHandler:")]
void DeleteAllSavedUserActivities (Action handler);
// Inlined from NSUserActivity (UISceneActivationConditions)
[iOS (13,0), TV (13,0), Mac (10,15), Watch (6,0)]
[NullAllowed, Export ("targetContentIdentifier")]
string TargetContentIdentifier { get; set; }
#if HAS_APPCLIP
// Inlined from NSUserActivity (AppClip)
[iOS (14,0)][NoTV][NoMac][NoWatch]
[Export ("appClipActivationPayload", ArgumentSemantic.Strong)]
[NullAllowed]
APActivationPayload AppClipActivationPayload { get; }
#endif
}
[iOS (8,0)][Mac (10,10)] // same as NSUserActivity
[Static]
partial interface NSUserActivityType {
[Field ("NSUserActivityTypeBrowsingWeb")]
NSString BrowsingWeb { get; }
}
[iOS (8,0)][Mac (10,10), Watch (3,0), TV (9,0)] // same as NSUserActivity
[Protocol, Model]
[BaseType (typeof (NSObject))]
partial interface NSUserActivityDelegate {
[Export ("userActivityWillSave:")]
void UserActivityWillSave (NSUserActivity userActivity);
[Export ("userActivityWasContinued:")]
void UserActivityWasContinued (NSUserActivity userActivity);
[Export ("userActivity:didReceiveInputStream:outputStream:")]
void UserActivityReceivedData (NSUserActivity userActivity, NSInputStream inputStream, NSOutputStream outputStream);
}
[BaseType (typeof (NSObject))]
interface NSUserDefaults {
[Export ("URLForKey:")]
[return: NullAllowed]
NSUrl URLForKey (string defaultName);
[Export ("setURL:forKey:")]
void SetURL ([NullAllowed] NSUrl url, string defaultName);
[Static]
[Export ("standardUserDefaults", ArgumentSemantic.Strong)]
NSUserDefaults StandardUserDefaults { get; }
[Static]
[Export ("resetStandardUserDefaults")]
void ResetStandardUserDefaults ();
[Internal]
[Export ("initWithUser:")]
IntPtr InitWithUserName (string username);
[Internal]
[iOS (7,0), Mac (10, 9)]
[Export ("initWithSuiteName:")]
IntPtr InitWithSuiteName (string suiteName);
[Export ("objectForKey:")][Internal]
NSObject ObjectForKey (string defaultName);
[Export ("setObject:forKey:")][Internal]
void SetObjectForKey (NSObject value, string defaultName);
[Export ("removeObjectForKey:")]
void RemoveObject (string defaultName);
[Export ("stringForKey:")]
string StringForKey (string defaultName);
[Export ("arrayForKey:")]
NSObject [] ArrayForKey (string defaultName);
[Export ("dictionaryForKey:")]
NSDictionary DictionaryForKey (string defaultName);
[Export ("dataForKey:")]
NSData DataForKey (string defaultName);
[Export ("stringArrayForKey:")]
string [] StringArrayForKey (string defaultName);
[Export ("integerForKey:")]
nint IntForKey (string defaultName);
[Export ("floatForKey:")]
float FloatForKey (string defaultName); // this is defined as float, not CGFloat.
[Export ("doubleForKey:")]
double DoubleForKey (string defaultName);
[Export ("boolForKey:")]
bool BoolForKey (string defaultName);
[Export ("setInteger:forKey:")]
void SetInt (nint value, string defaultName);
[Export ("setFloat:forKey:")]
void SetFloat (float value /* this is defined as float, not CGFloat */, string defaultName);
[Export ("setDouble:forKey:")]
void SetDouble (double value, string defaultName);
[Export ("setBool:forKey:")]
void SetBool (bool value, string defaultName);
[Export ("registerDefaults:")]
void RegisterDefaults (NSDictionary registrationDictionary);
[Export ("addSuiteNamed:")]
void AddSuite (string suiteName);
[Export ("removeSuiteNamed:")]
void RemoveSuite (string suiteName);
[Export ("dictionaryRepresentation")]
NSDictionary ToDictionary ();
[Export ("volatileDomainNames")]
#if XAMCORE_5_0
string [] VolatileDomainNames { get; }
#else
string [] VolatileDomainNames ();
#endif
[Export ("volatileDomainForName:")]
NSDictionary GetVolatileDomain (string domainName);
[Export ("setVolatileDomain:forName:")]
void SetVolatileDomain (NSDictionary domain, string domainName);
[Export ("removeVolatileDomainForName:")]
void RemoveVolatileDomain (string domainName);
[Deprecated (PlatformName.iOS, 7, 0)]
[Deprecated (PlatformName.MacOSX, 10, 9)]
[Export ("persistentDomainNames")]
string [] PersistentDomainNames ();
[Export ("persistentDomainForName:")]
NSDictionary PersistentDomainForName (string domainName);
[Export ("setPersistentDomain:forName:")]
void SetPersistentDomain (NSDictionary domain, string domainName);
[Export ("removePersistentDomainForName:")]
void RemovePersistentDomain (string domainName);
[Export ("synchronize")]
bool Synchronize ();
[Export ("objectIsForcedForKey:")]
bool ObjectIsForced (string key);
[Export ("objectIsForcedForKey:inDomain:")]
bool ObjectIsForced (string key, string domain);
[Field ("NSGlobalDomain")]
NSString GlobalDomain { get; }
[Field ("NSArgumentDomain")]
NSString ArgumentDomain { get; }
[Field ("NSRegistrationDomain")]
NSString RegistrationDomain { get; }
[iOS (9,3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[NoMac][NoTV]
[Notification]
[Field ("NSUserDefaultsSizeLimitExceededNotification")]
NSString SizeLimitExceededNotification { get; }
[iOS (10,0)][TV (10,0)][Watch (3,0)][NoMac]
[Notification]
[Field ("NSUbiquitousUserDefaultsNoCloudAccountNotification")]
NSString NoCloudAccountNotification { get; }
[iOS (9,3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[NoMac][NoTV]
[Notification]
[Field ("NSUbiquitousUserDefaultsDidChangeAccountsNotification")]
NSString DidChangeAccountsNotification { get; }
[iOS (9,3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[NoMac][NoTV]
[Notification]
[Field ("NSUbiquitousUserDefaultsCompletedInitialSyncNotification")]
NSString CompletedInitialSyncNotification { get; }
[Notification]
[Field ("NSUserDefaultsDidChangeNotification")]
NSString DidChangeNotification { get; }
}
[BaseType (typeof (NSObject), Name="NSURL")]
// init returns NIL
[DisableDefaultCtor]
partial interface NSUrl : NSSecureCoding, NSCopying
#if MONOMAC
, NSPasteboardReading, NSPasteboardWriting
#endif
, NSItemProviderWriting, NSItemProviderReading
#if IOS || MONOMAC
, QLPreviewItem
#endif
{
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'NSUrlComponents' instead.")]
[Deprecated (PlatformName.WatchOS, 2, 0, message : "Use 'NSUrlComponents' instead.")]
[Deprecated (PlatformName.TvOS, 9, 0, message : "Use 'NSUrlComponents' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'NSUrlComponents' instead.")]
[Export ("initWithScheme:host:path:")]
NativeHandle Constructor (string scheme, string host, string path);
[DesignatedInitializer]
[Export ("initFileURLWithPath:isDirectory:")]
NativeHandle Constructor (string path, bool isDir);
[Export ("initWithString:")]
NativeHandle Constructor (string urlString);
[DesignatedInitializer]
[Export ("initWithString:relativeToURL:")]
NativeHandle Constructor (string urlString, NSUrl relativeToUrl);
[return: NullAllowed]
[Export ("URLWithString:")][Static]
NSUrl FromString ([NullAllowed] string s);
[Export ("URLWithString:relativeToURL:")][Internal][Static]
NSUrl _FromStringRelative (string url, NSUrl relative);
[Export ("absoluteString")]
string AbsoluteString { get; }
[Export ("absoluteURL")]
NSUrl AbsoluteUrl { get; }
[Export ("baseURL")]
NSUrl BaseUrl { get; }
[Export ("fragment")]
string Fragment { get; }
[Export ("host")]
string Host { get; }
[Internal]
[Export ("isEqual:")]
bool IsEqual ([NullAllowed] NSUrl other);
[Export ("isFileURL")]
bool IsFileUrl { get; }
[Export ("isFileReferenceURL")]
bool IsFileReferenceUrl { get; }
[Deprecated (PlatformName.MacOSX, 10,15, message: "Always return 'null'. Use and parse 'Path' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Always return 'null'. Use and parse 'Path' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Always return 'null'. Use and parse 'Path' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Always return 'null'. Use and parse 'Path' instead.")]
[Export ("parameterString")]
string ParameterString { get;}
[Export ("password")]
string Password { get;}
[Export ("path")]
string Path { get;}
[Export ("query")]
string Query { get;}
[Export ("relativePath")]
string RelativePath { get;}
[Export ("pathComponents")]
string [] PathComponents { get; }
[Export ("lastPathComponent")]
string LastPathComponent { get; }
[Export ("pathExtension")]
string PathExtension { get; }
[Export ("relativeString")]
string RelativeString { get;}
[Export ("resourceSpecifier")]
string ResourceSpecifier { get;}
[Export ("scheme")]
string Scheme { get;}
[Export ("user")]
string User { get;}
[Export ("standardizedURL")]
NSUrl StandardizedUrl { get; }
[Export ("URLByAppendingPathComponent:isDirectory:")]
NSUrl Append (string pathComponent, bool isDirectory);
[Export ("URLByAppendingPathExtension:")]
NSUrl AppendPathExtension (string extension);
[Export ("URLByDeletingLastPathComponent")]
NSUrl RemoveLastPathComponent ();
[Export ("URLByDeletingPathExtension")]
NSUrl RemovePathExtension ();
[iOS (7,0), Mac (10, 9)]
[Export ("getFileSystemRepresentation:maxLength:")]
bool GetFileSystemRepresentation (IntPtr buffer, nint maxBufferLength);
[iOS (7,0), Mac (10, 9)]
[Export ("fileSystemRepresentation")]
IntPtr GetFileSystemRepresentationAsUtf8Ptr { get; }
[iOS (7,0), Mac (10, 9)]
[Export ("removeCachedResourceValueForKey:")]
void RemoveCachedResourceValueForKey (NSString key);
[iOS (7,0), Mac (10, 9)]
[Export ("removeAllCachedResourceValues")]
void RemoveAllCachedResourceValues ();
[iOS (7,0), Mac (10, 9)]
[Export ("setTemporaryResourceValue:forKey:")]
void SetTemporaryResourceValue (NSObject value, NSString key);
[DesignatedInitializer]
[iOS (7,0), Mac (10, 9)]
[Export ("initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:")]
NativeHandle Constructor (IntPtr ptrUtf8path, bool isDir, [NullAllowed] NSUrl baseURL);
[iOS (7,0), Mac (10, 9), Static, Export ("fileURLWithFileSystemRepresentation:isDirectory:relativeToURL:")]
NSUrl FromUTF8Pointer (IntPtr ptrUtf8path, bool isDir, [NullAllowed] NSUrl baseURL);
/* These methods come from NURL_AppKitAdditions */
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("URLFromPasteboard:")]
[Static]
NSUrl FromPasteboard (NSPasteboard pasteboard);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("writeToPasteboard:")]
void WriteToPasteboard (NSPasteboard pasteboard);
[Export("bookmarkDataWithContentsOfURL:error:")]
[Static]
NSData GetBookmarkData (NSUrl bookmarkFileUrl, out NSError error);
[Export("URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:")]
[Static]
NSUrl FromBookmarkData (NSData data, NSUrlBookmarkResolutionOptions options, [NullAllowed] NSUrl relativeToUrl, out bool isStale, out NSError error);
[Export("writeBookmarkData:toURL:options:error:")]
[Static]
bool WriteBookmarkData (NSData data, NSUrl bookmarkFileUrl, NSUrlBookmarkCreationOptions options, out NSError error);
[Export("filePathURL")]
NSUrl FilePathUrl { get; }
[Export("fileReferenceURL")]
NSUrl FileReferenceUrl { get; }
[Export ("getResourceValue:forKey:error:"), Internal]
bool GetResourceValue (out NSObject value, NSString key, out NSError error);
[Export ("resourceValuesForKeys:error:")]
NSDictionary GetResourceValues (NSString [] keys, out NSError error);
[Export ("setResourceValue:forKey:error:"), Internal]
bool SetResourceValue (NSObject value, NSString key, out NSError error);
[Export ("port"), Internal]
[NullAllowed]
NSNumber PortNumber { get; }
[Field ("NSURLNameKey")]
NSString NameKey { get; }
[Field ("NSURLLocalizedNameKey")]
NSString LocalizedNameKey { get; }
[Field ("NSURLIsRegularFileKey")]
NSString IsRegularFileKey { get; }
[Field ("NSURLIsDirectoryKey")]
NSString IsDirectoryKey { get; }
[Field ("NSURLIsSymbolicLinkKey")]
NSString IsSymbolicLinkKey { get; }
[Field ("NSURLIsVolumeKey")]
NSString IsVolumeKey { get; }
[Field ("NSURLIsPackageKey")]
NSString IsPackageKey { get; }
[Field ("NSURLIsSystemImmutableKey")]
NSString IsSystemImmutableKey { get; }
[Field ("NSURLIsUserImmutableKey")]
NSString IsUserImmutableKey { get; }
[Field ("NSURLIsHiddenKey")]
NSString IsHiddenKey { get; }
[Field ("NSURLHasHiddenExtensionKey")]
NSString HasHiddenExtensionKey { get; }
[Field ("NSURLCreationDateKey")]
NSString CreationDateKey { get; }
[Field ("NSURLContentAccessDateKey")]
NSString ContentAccessDateKey { get; }
[Field ("NSURLContentModificationDateKey")]
NSString ContentModificationDateKey { get; }
[Field ("NSURLAttributeModificationDateKey")]
NSString AttributeModificationDateKey { get; }
[Field ("NSURLLinkCountKey")]
NSString LinkCountKey { get; }
[Field ("NSURLParentDirectoryURLKey")]
NSString ParentDirectoryURLKey { get; }
[Field ("NSURLVolumeURLKey")]
NSString VolumeURLKey { get; }
[Deprecated (PlatformName.iOS, 14,0, message: "Use 'ContentTypeKey' instead.")]
[Deprecated (PlatformName.TvOS, 14,0, message: "Use 'ContentTypeKey' instead.")]
[Deprecated (PlatformName.WatchOS, 7,0, message: "Use 'ContentTypeKey' instead.")]
[Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'ContentTypeKey' instead.")]
[Field ("NSURLTypeIdentifierKey")]
NSString TypeIdentifierKey { get; }
[Field ("NSURLLocalizedTypeDescriptionKey")]
NSString LocalizedTypeDescriptionKey { get; }
[Field ("NSURLLabelNumberKey")]
NSString LabelNumberKey { get; }
[Field ("NSURLLabelColorKey")]
NSString LabelColorKey { get; }
[Field ("NSURLLocalizedLabelKey")]
NSString LocalizedLabelKey { get; }
[Field ("NSURLEffectiveIconKey")]
NSString EffectiveIconKey { get; }
[Field ("NSURLCustomIconKey")]
NSString CustomIconKey { get; }
[Field ("NSURLFileSizeKey")]
NSString FileSizeKey { get; }
[Field ("NSURLFileAllocatedSizeKey")]
NSString FileAllocatedSizeKey { get; }
[Field ("NSURLIsAliasFileKey")]
NSString IsAliasFileKey { get; }
[Field ("NSURLVolumeLocalizedFormatDescriptionKey")]
NSString VolumeLocalizedFormatDescriptionKey { get; }
[Field ("NSURLVolumeTotalCapacityKey")]
NSString VolumeTotalCapacityKey { get; }
[Field ("NSURLVolumeAvailableCapacityKey")]
NSString VolumeAvailableCapacityKey { get; }
[Field ("NSURLVolumeResourceCountKey")]
NSString VolumeResourceCountKey { get; }
[Field ("NSURLVolumeSupportsPersistentIDsKey")]
NSString VolumeSupportsPersistentIDsKey { get; }
[Field ("NSURLVolumeSupportsSymbolicLinksKey")]
NSString VolumeSupportsSymbolicLinksKey { get; }
[Field ("NSURLVolumeSupportsHardLinksKey")]
NSString VolumeSupportsHardLinksKey { get; }
[Field ("NSURLVolumeSupportsJournalingKey")]
NSString VolumeSupportsJournalingKey { get; }
[Field ("NSURLVolumeIsJournalingKey")]
NSString VolumeIsJournalingKey { get; }
[Field ("NSURLVolumeSupportsSparseFilesKey")]
NSString VolumeSupportsSparseFilesKey { get; }
[Field ("NSURLVolumeSupportsZeroRunsKey")]
NSString VolumeSupportsZeroRunsKey { get; }
[Field ("NSURLVolumeSupportsCaseSensitiveNamesKey")]
NSString VolumeSupportsCaseSensitiveNamesKey { get; }
[Field ("NSURLVolumeSupportsCasePreservedNamesKey")]
NSString VolumeSupportsCasePreservedNamesKey { get; }
// 5.0 Additions
[Field ("NSURLKeysOfUnsetValuesKey")]
NSString KeysOfUnsetValuesKey { get; }
[Field ("NSURLFileResourceIdentifierKey")]
NSString FileResourceIdentifierKey { get; }
[Field ("NSURLVolumeIdentifierKey")]
NSString VolumeIdentifierKey { get; }
[Field ("NSURLPreferredIOBlockSizeKey")]
NSString PreferredIOBlockSizeKey { get; }
[Field ("NSURLIsReadableKey")]
NSString IsReadableKey { get; }
[Field ("NSURLIsWritableKey")]
NSString IsWritableKey { get; }
[Field ("NSURLIsExecutableKey")]
NSString IsExecutableKey { get; }
[Field ("NSURLIsMountTriggerKey")]
NSString IsMountTriggerKey { get; }
[Field ("NSURLFileSecurityKey")]
NSString FileSecurityKey { get; }
[Field ("NSURLFileResourceTypeKey")]
NSString FileResourceTypeKey { get; }
[Field ("NSURLFileResourceTypeNamedPipe")]
NSString FileResourceTypeNamedPipe { get; }
[Field ("NSURLFileResourceTypeCharacterSpecial")]
NSString FileResourceTypeCharacterSpecial { get; }
[Field ("NSURLFileResourceTypeDirectory")]
NSString FileResourceTypeDirectory { get; }
[Field ("NSURLFileResourceTypeBlockSpecial")]
NSString FileResourceTypeBlockSpecial { get; }
[Field ("NSURLFileResourceTypeRegular")]
NSString FileResourceTypeRegular { get; }
[Field ("NSURLFileResourceTypeSymbolicLink")]
NSString FileResourceTypeSymbolicLink { get; }
[Field ("NSURLFileResourceTypeSocket")]
NSString FileResourceTypeSocket { get; }
[Field ("NSURLFileResourceTypeUnknown")]
NSString FileResourceTypeUnknown { get; }
[Field ("NSURLTotalFileSizeKey")]
NSString TotalFileSizeKey { get; }
[Field ("NSURLTotalFileAllocatedSizeKey")]
NSString TotalFileAllocatedSizeKey { get; }
[Field ("NSURLVolumeSupportsRootDirectoryDatesKey")]
NSString VolumeSupportsRootDirectoryDatesKey { get; }
[Field ("NSURLVolumeSupportsVolumeSizesKey")]
NSString VolumeSupportsVolumeSizesKey { get; }
[Field ("NSURLVolumeSupportsRenamingKey")]
NSString VolumeSupportsRenamingKey { get; }
[Field ("NSURLVolumeSupportsAdvisoryFileLockingKey")]
NSString VolumeSupportsAdvisoryFileLockingKey { get; }
[Field ("NSURLVolumeSupportsExtendedSecurityKey")]
NSString VolumeSupportsExtendedSecurityKey { get; }
[Field ("NSURLVolumeIsBrowsableKey")]
NSString VolumeIsBrowsableKey { get; }
[Field ("NSURLVolumeMaximumFileSizeKey")]
NSString VolumeMaximumFileSizeKey { get; }
[Field ("NSURLVolumeIsEjectableKey")]
NSString VolumeIsEjectableKey { get; }
[Field ("NSURLVolumeIsRemovableKey")]
NSString VolumeIsRemovableKey { get; }
[Field ("NSURLVolumeIsInternalKey")]
NSString VolumeIsInternalKey { get; }
[Field ("NSURLVolumeIsAutomountedKey")]
NSString VolumeIsAutomountedKey { get; }
[Field ("NSURLVolumeIsLocalKey")]
NSString VolumeIsLocalKey { get; }
[Field ("NSURLVolumeIsReadOnlyKey")]
NSString VolumeIsReadOnlyKey { get; }
[Field ("NSURLVolumeCreationDateKey")]
NSString VolumeCreationDateKey { get; }
[Field ("NSURLVolumeURLForRemountingKey")]
NSString VolumeURLForRemountingKey { get; }
[Field ("NSURLVolumeUUIDStringKey")]
NSString VolumeUUIDStringKey { get; }
[Field ("NSURLVolumeNameKey")]
NSString VolumeNameKey { get; }
[Field ("NSURLVolumeLocalizedNameKey")]
NSString VolumeLocalizedNameKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeIsEncryptedKey")]
NSString VolumeIsEncryptedKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeIsRootFileSystemKey")]
NSString VolumeIsRootFileSystemKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeSupportsCompressionKey")]
NSString VolumeSupportsCompressionKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeSupportsFileCloningKey")]
NSString VolumeSupportsFileCloningKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeSupportsSwapRenamingKey")]
NSString VolumeSupportsSwapRenamingKey { get; }
[Watch (3, 0), TV (10, 0), Mac (10, 12), iOS (10, 0)]
[Field ("NSURLVolumeSupportsExclusiveRenamingKey")]
NSString VolumeSupportsExclusiveRenamingKey { get; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Field ("NSURLVolumeSupportsImmutableFilesKey")]
NSString VolumeSupportsImmutableFilesKey { get; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Field ("NSURLVolumeSupportsAccessPermissionsKey")]
NSString VolumeSupportsAccessPermissionsKey { get; }
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLVolumeSupportsFileProtectionKey")]
NSString VolumeSupportsFileProtectionKey { get; }
[NoWatch, NoTV, Mac (10, 13), iOS (11, 0)]
[Field ("NSURLVolumeAvailableCapacityForImportantUsageKey")]
NSString VolumeAvailableCapacityForImportantUsageKey { get; }
[NoWatch, NoTV, Mac (10, 13), iOS (11, 0)]
[Field ("NSURLVolumeAvailableCapacityForOpportunisticUsageKey")]
NSString VolumeAvailableCapacityForOpportunisticUsageKey { get; }
[Field ("NSURLIsUbiquitousItemKey")]
NSString IsUbiquitousItemKey { get; }
[Field ("NSURLUbiquitousItemHasUnresolvedConflictsKey")]
NSString UbiquitousItemHasUnresolvedConflictsKey { get; }
[Field ("NSURLUbiquitousItemIsDownloadedKey")]
NSString UbiquitousItemIsDownloadedKey { get; }
[Field ("NSURLUbiquitousItemIsDownloadingKey")]
[Deprecated (PlatformName.iOS, 7, 0)]
NSString UbiquitousItemIsDownloadingKey { get; }
[Field ("NSURLUbiquitousItemIsUploadedKey")]
NSString UbiquitousItemIsUploadedKey { get; }
[Field ("NSURLUbiquitousItemIsUploadingKey")]
NSString UbiquitousItemIsUploadingKey { get; }
[Field ("NSURLUbiquitousItemPercentDownloadedKey")]
[Deprecated (PlatformName.iOS, 6, 0, message : "Use 'NSMetadataQuery.UbiquitousItemPercentDownloadedKey' on 'NSMetadataItem' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 8, message : "Use 'NSMetadataQuery.UbiquitousItemPercentDownloadedKey' on 'NSMetadataItem' instead.")]
NSString UbiquitousItemPercentDownloadedKey { get; }
[Deprecated (PlatformName.iOS, 6, 0, message : "Use 'NSMetadataQuery.UbiquitousItemPercentUploadedKey' on 'NSMetadataItem' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 8, message : "Use 'NSMetadataQuery.UbiquitousItemPercentUploadedKey' on 'NSMetadataItem' instead.")]
[Field ("NSURLUbiquitousItemPercentUploadedKey")]
NSString UbiquitousItemPercentUploadedKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousItemIsSharedKey")]
NSString UbiquitousItemIsSharedKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemCurrentUserRoleKey")]
NSString UbiquitousSharedItemCurrentUserRoleKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemCurrentUserPermissionsKey")]
NSString UbiquitousSharedItemCurrentUserPermissionsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemOwnerNameComponentsKey")]
NSString UbiquitousSharedItemOwnerNameComponentsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey")]
NSString UbiquitousSharedItemMostRecentEditorNameComponentsKey { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemRoleOwner")]
NSString UbiquitousSharedItemRoleOwner { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemRoleParticipant")]
NSString UbiquitousSharedItemRoleParticipant { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemPermissionsReadOnly")]
NSString UbiquitousSharedItemPermissionsReadOnly { get; }
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[Field ("NSURLUbiquitousSharedItemPermissionsReadWrite")]
NSString UbiquitousSharedItemPermissionsReadWrite { get; }
[Field ("NSURLIsExcludedFromBackupKey")]
NSString IsExcludedFromBackupKey { get; }
[Export ("bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:")]
NSData CreateBookmarkData (NSUrlBookmarkCreationOptions options, [NullAllowed] string [] resourceValues, [NullAllowed] NSUrl relativeUrl, out NSError error);
[Export ("initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:")]
NativeHandle Constructor (NSData bookmarkData, NSUrlBookmarkResolutionOptions resolutionOptions, [NullAllowed] NSUrl relativeUrl, out bool bookmarkIsStale, out NSError error);
[Field ("NSURLPathKey")]
NSString PathKey { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemDownloadingStatusKey")]
NSString UbiquitousItemDownloadingStatusKey { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemDownloadingErrorKey")]
NSString UbiquitousItemDownloadingErrorKey { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemUploadingErrorKey")]
NSString UbiquitousItemUploadingErrorKey { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemDownloadingStatusNotDownloaded")]
NSString UbiquitousItemDownloadingStatusNotDownloaded { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemDownloadingStatusDownloaded")]
NSString UbiquitousItemDownloadingStatusDownloaded { get; }
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLUbiquitousItemDownloadingStatusCurrent")]
NSString UbiquitousItemDownloadingStatusCurrent { get; }
[iOS (8,0)]
[Export ("startAccessingSecurityScopedResource")]
bool StartAccessingSecurityScopedResource ();
[iOS (8,0)]
[Export ("stopAccessingSecurityScopedResource")]
void StopAccessingSecurityScopedResource ();
[Mac (10,10), iOS (8,0)]
[Static, Export ("URLByResolvingAliasFileAtURL:options:error:")]
NSUrl ResolveAlias (NSUrl aliasFileUrl, NSUrlBookmarkResolutionOptions options, out NSError error);
[Static, Export ("fileURLWithPathComponents:")]
NSUrl CreateFileUrl (string [] pathComponents);
[Mac (10,10), iOS (8,0)]
[Field ("NSURLAddedToDirectoryDateKey")]
NSString AddedToDirectoryDateKey { get; }
[Mac (10,10), iOS (8,0)]
[Field ("NSURLDocumentIdentifierKey")]
NSString DocumentIdentifierKey { get; }
[Mac (10,10), iOS (8,0)]
[Field ("NSURLGenerationIdentifierKey")]
NSString GenerationIdentifierKey { get; }
[Mac (10,10), iOS (8,0)]
[Field ("NSURLThumbnailDictionaryKey")]
NSString ThumbnailDictionaryKey { get; }
[Mac (10,10), iOS (8,0)]
[Field ("NSURLUbiquitousItemContainerDisplayNameKey")]
NSString UbiquitousItemContainerDisplayNameKey { get; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[MacCatalyst (14,5)]
[Field ("NSURLUbiquitousItemIsExcludedFromSyncKey")]
NSString UbiquitousItemIsExcludedFromSyncKey { get; }
[Mac (10,10), iOS (8,0)]
[Field ("NSURLUbiquitousItemDownloadRequestedKey")]
NSString UbiquitousItemDownloadRequestedKey { get; }
//
// iOS 9.0/osx 10.11 additions
//
[DesignatedInitializer]
[iOS (9,0), Mac(10,11)]
[Export ("initFileURLWithPath:isDirectory:relativeToURL:")]
NativeHandle Constructor (string path, bool isDir, [NullAllowed] NSUrl relativeToUrl);
[iOS (9,0), Mac(10,11)]
[Static]
[Export ("fileURLWithPath:isDirectory:relativeToURL:")]
NSUrl CreateFileUrl (string path, bool isDir, [NullAllowed] NSUrl relativeToUrl);
[iOS (9,0), Mac(10,11)]
[Static]
[Export ("fileURLWithPath:relativeToURL:")]
NSUrl CreateFileUrl (string path, [NullAllowed] NSUrl relativeToUrl);
[iOS (9,0), Mac(10,11)]
[Static]
[Export ("URLWithDataRepresentation:relativeToURL:")]
NSUrl CreateWithDataRepresentation (NSData data, [NullAllowed] NSUrl relativeToUrl);
[iOS (9,0), Mac(10,11)]
[Static]
[Export ("absoluteURLWithDataRepresentation:relativeToURL:")]
NSUrl CreateAbsoluteUrlWithDataRepresentation (NSData data, [NullAllowed] NSUrl relativeToUrl);
[iOS (9,0), Mac(10,11)]
[Export ("dataRepresentation", ArgumentSemantic.Copy)]
NSData DataRepresentation { get; }
[iOS (9,0), Mac(10,11)]
[Export ("hasDirectoryPath")]
bool HasDirectoryPath { get; }
[iOS (9,0), Mac(10,11)]
[Field ("NSURLIsApplicationKey")]
NSString IsApplicationKey { get; }
[iOS (9,0), Mac(11,0)]
[Field ("NSURLFileProtectionKey")]
NSString FileProtectionKey { get; }
[iOS (9,0), Mac(10,11)]
[Field ("NSURLFileProtectionNone")]
NSString FileProtectionNone { get; }
[iOS (9,0), Mac(10,11)]
[Field ("NSURLFileProtectionComplete")]
NSString FileProtectionComplete { get; }
[iOS (9,0), Mac(10,11)]
[Field ("NSURLFileProtectionCompleteUnlessOpen")]
NSString FileProtectionCompleteUnlessOpen { get; }
[iOS (9,0), Mac(10,11)]
[Field ("NSURLFileProtectionCompleteUntilFirstUserAuthentication")]
NSString FileProtectionCompleteUntilFirstUserAuthentication { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLContentTypeKey")]
NSString ContentTypeKey { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLFileContentIdentifierKey")]
NSString FileContentIdentifierKey { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLIsPurgeableKey")]
NSString IsPurgeableKey { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLIsSparseKey")]
NSString IsSparseKey { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLMayHaveExtendedAttributesKey")]
NSString MayHaveExtendedAttributesKey { get; }
[Watch (7,0)][TV (14,0)][Mac (11,0)][iOS (14,0)]
[MacCatalyst (14,0)]
[Field ("NSURLMayShareFileContentKey")]
NSString MayShareFileContentKey { get; }
// From the NSItemProviderReading protocol
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
new string[] ReadableTypeIdentifiers { get; }
// From the NSItemProviderReading protocol
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("objectWithItemProviderData:typeIdentifier:error:")]
[return: NullAllowed]
new NSUrl GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError);
// From the NSItemProviderWriting protocol
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
new string[] WritableTypeIdentifiers { get; }
}
//
// Just a category so we can document the three methods together
//
[Category, BaseType (typeof (NSUrl))]
partial interface NSUrl_PromisedItems {
[Mac (10,10), iOS (8,0)]
[Export ("checkPromisedItemIsReachableAndReturnError:")]
bool CheckPromisedItemIsReachable (out NSError error);
[Mac (10,10), iOS (8,0)]
[Export ("getPromisedItemResourceValue:forKey:error:")]
bool GetPromisedItemResourceValue (out NSObject value, NSString key, out NSError error);
[Mac (10,10), iOS (8,0)]
[Export ("promisedItemResourceValuesForKeys:error:")]
[return: NullAllowed]
NSDictionary GetPromisedItemResourceValues (NSString [] keys, out NSError error);
}
[iOS (8,0), Mac (10,10)]
[BaseType (typeof (NSObject), Name="NSURLQueryItem")]
interface NSUrlQueryItem : NSSecureCoding, NSCopying {
[DesignatedInitializer]
[Export ("initWithName:value:")]
NativeHandle Constructor (string name, string value);
[Export ("name")]
string Name { get; }
[Export ("value")]
string Value { get; }
}
[Category, BaseType (typeof (NSCharacterSet))]
partial interface NSUrlUtilities_NSCharacterSet {
[iOS (7,0), Static, Export ("URLUserAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlUserAllowedCharacterSet { get; }
[iOS (7,0), Static, Export ("URLPasswordAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlPasswordAllowedCharacterSet { get; }
[iOS (7,0), Static, Export ("URLHostAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlHostAllowedCharacterSet { get; }
[iOS (7,0), Static, Export ("URLPathAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlPathAllowedCharacterSet { get; }
[iOS (7,0), Static, Export ("URLQueryAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlQueryAllowedCharacterSet { get; }
[iOS (7,0), Static, Export ("URLFragmentAllowedCharacterSet", ArgumentSemantic.Copy)]
NSCharacterSet UrlFragmentAllowedCharacterSet { get; }
}
[BaseType (typeof (NSObject), Name="NSURLCache")]
interface NSUrlCache {
[Export ("sharedURLCache", ArgumentSemantic.Strong), Static]
NSUrlCache SharedCache { get; set; }
[Deprecated (PlatformName.MacOSX, 10,15, message : "Use the overload that accepts an 'NSUrl' parameter instead.")]
[Deprecated (PlatformName.iOS, 13,0, message : "Use the overload that accepts an 'NSUrl' parameter instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message : "Use the overload that accepts an 'NSUrl' parameter instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message : "Use the overload that accepts an 'NSUrl' parameter instead.")]
[Export ("initWithMemoryCapacity:diskCapacity:diskPath:")]
NativeHandle Constructor (nuint memoryCapacity, nuint diskCapacity, [NullAllowed] string diskPath);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("initWithMemoryCapacity:diskCapacity:directoryURL:")]
NativeHandle Constructor (nuint memoryCapacity, nuint diskCapacity, [NullAllowed] NSUrl directoryUrl);
[Export ("cachedResponseForRequest:")]
NSCachedUrlResponse CachedResponseForRequest (NSUrlRequest request);
[Export ("storeCachedResponse:forRequest:")]
void StoreCachedResponse (NSCachedUrlResponse cachedResponse, NSUrlRequest forRequest);
[Export ("removeCachedResponseForRequest:")]
void RemoveCachedResponse (NSUrlRequest request);
[Export ("removeAllCachedResponses")]
void RemoveAllCachedResponses ();
[Export ("memoryCapacity")]
nuint MemoryCapacity { get; set; }
[Export ("diskCapacity")]
nuint DiskCapacity { get; set; }
[Export ("currentMemoryUsage")]
nuint CurrentMemoryUsage { get; }
[Export ("currentDiskUsage")]
nuint CurrentDiskUsage { get; }
[Mac(10,10)][iOS(8,0)]
[Export ("removeCachedResponsesSinceDate:")]
void RemoveCachedResponsesSinceDate (NSDate date);
[iOS (8,0), Mac(10,10)]
[Export ("storeCachedResponse:forDataTask:")]
void StoreCachedResponse (NSCachedUrlResponse cachedResponse, NSUrlSessionDataTask dataTask);
[iOS (8,0), Mac(10,10)]
[Export ("getCachedResponseForDataTask:completionHandler:")]
[Async]
void GetCachedResponse (NSUrlSessionDataTask dataTask, Action<NSCachedUrlResponse> completionHandler);
[iOS (8,0), Mac(10,10)]
[Export ("removeCachedResponseForDataTask:")]
void RemoveCachedResponse (NSUrlSessionDataTask dataTask);
}
[iOS (7,0), Mac (10, 9)]
[BaseType (typeof (NSObject), Name="NSURLComponents")]
partial interface NSUrlComponents : NSCopying {
[Export ("initWithURL:resolvingAgainstBaseURL:")]
NativeHandle Constructor (NSUrl url, bool resolveAgainstBaseUrl);
[Static, Export ("componentsWithURL:resolvingAgainstBaseURL:")]
NSUrlComponents FromUrl (NSUrl url, bool resolvingAgainstBaseUrl);
[Export ("initWithString:")]
NativeHandle Constructor (string urlString);
[Static, Export ("componentsWithString:")]
NSUrlComponents FromString (string urlString);
[Export ("URL")]
NSUrl Url { get; }
[Export ("URLRelativeToURL:")]
NSUrl GetRelativeUrl (NSUrl baseUrl);
[NullAllowed] // by default this property is null
[Export ("scheme", ArgumentSemantic.Copy)]
string Scheme { get; set; }
[NullAllowed] // by default this property is null
[Export ("user", ArgumentSemantic.Copy)]
string User { get; set; }
[NullAllowed] // by default this property is null
[Export ("password", ArgumentSemantic.Copy)]
string Password { get; set; }
[NullAllowed] // by default this property is null
[Export ("host", ArgumentSemantic.Copy)]
string Host { get; set; }
[NullAllowed] // by default this property is null
[Export ("port", ArgumentSemantic.Copy)]
NSNumber Port { get; set; }
[NullAllowed] // by default this property is null
[Export ("path", ArgumentSemantic.Copy)]
string Path { get; set; }
[NullAllowed] // by default this property is null
[Export ("query", ArgumentSemantic.Copy)]
string Query { get; set; }
[NullAllowed] // by default this property is null
[Export ("fragment", ArgumentSemantic.Copy)]
string Fragment { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedUser", ArgumentSemantic.Copy)]
string PercentEncodedUser { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedPassword", ArgumentSemantic.Copy)]
string PercentEncodedPassword { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedHost", ArgumentSemantic.Copy)]
string PercentEncodedHost { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedPath", ArgumentSemantic.Copy)]
string PercentEncodedPath { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedQuery", ArgumentSemantic.Copy)]
string PercentEncodedQuery { get; set; }
[NullAllowed] // by default this property is null
[Export ("percentEncodedFragment", ArgumentSemantic.Copy)]
string PercentEncodedFragment { get; set; }
[Mac (10,10), iOS (8,0)]
[NullAllowed] // by default this property is null
[Export ("queryItems")]
NSUrlQueryItem [] QueryItems { get; set; }
[Mac (10,10), iOS (8,0)]
[Export ("string")]
string AsString ();
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfScheme")]
NSRange RangeOfScheme { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfUser")]
NSRange RangeOfUser { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfPassword")]
NSRange RangeOfPassword { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfHost")]
NSRange RangeOfHost { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfPort")]
NSRange RangeOfPort { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfPath")]
NSRange RangeOfPath { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfQuery")]
NSRange RangeOfQuery { get; }
[iOS (9,0), Mac(10,11)]
[Export ("rangeOfFragment")]
NSRange RangeOfFragment { get; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("percentEncodedQueryItems", ArgumentSemantic.Copy)]
NSUrlQueryItem[] PercentEncodedQueryItems { get; set; }
}
[BaseType (typeof (NSObject), Name="NSURLAuthenticationChallenge")]
// 'init' returns NIL
[DisableDefaultCtor]
interface NSUrlAuthenticationChallenge : NSSecureCoding {
[Export ("initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:")]
NativeHandle Constructor (NSUrlProtectionSpace space, NSUrlCredential credential, nint previousFailureCount, [NullAllowed] NSUrlResponse response, [NullAllowed] NSError error, NSUrlConnection sender);
[Export ("initWithAuthenticationChallenge:sender:")]
NativeHandle Constructor (NSUrlAuthenticationChallenge challenge, NSUrlConnection sender);
[Export ("protectionSpace")]
NSUrlProtectionSpace ProtectionSpace { get; }
[Export ("proposedCredential")]
NSUrlCredential ProposedCredential { get; }
[Export ("previousFailureCount")]
nint PreviousFailureCount { get; }
[Export ("failureResponse")]
NSUrlResponse FailureResponse { get; }
[Export ("error")]
NSError Error { get; }
[Export ("sender")]
NSUrlConnection Sender { get; }
}
[Protocol (Name = "NSURLAuthenticationChallengeSender")]
#if NET
interface NSUrlAuthenticationChallengeSender {
#else
[Model]
[BaseType (typeof (NSObject))]
interface NSURLAuthenticationChallengeSender {
#endif
[Abstract]
[Export ("useCredential:forAuthenticationChallenge:")]
void UseCredential (NSUrlCredential credential, NSUrlAuthenticationChallenge challenge);
[Abstract]
[Export ("continueWithoutCredentialForAuthenticationChallenge:")]
void ContinueWithoutCredential (NSUrlAuthenticationChallenge challenge);
[Abstract]
[Export ("cancelAuthenticationChallenge:")]
void CancelAuthenticationChallenge (NSUrlAuthenticationChallenge challenge);
[Export ("performDefaultHandlingForAuthenticationChallenge:")]
void PerformDefaultHandling (NSUrlAuthenticationChallenge challenge);
[Export ("rejectProtectionSpaceAndContinueWithChallenge:")]
void RejectProtectionSpaceAndContinue (NSUrlAuthenticationChallenge challenge);
}
delegate void NSUrlConnectionDataResponse (NSUrlResponse response, NSData data, NSError error);
[BaseType (typeof (NSObject), Name="NSURLConnection")]
interface NSUrlConnection :
#if NET
NSUrlAuthenticationChallengeSender
#else
NSURLAuthenticationChallengeSender
#endif
{
[Export ("canHandleRequest:")][Static]
bool CanHandleRequest (NSUrlRequest request);
[NoWatch]
[Deprecated (PlatformName.iOS, 9,0, message: "Use 'NSUrlSession' instead.")]
[Deprecated (PlatformName.MacOSX, 10,11, message: "Use 'NSUrlSession' instead.")]
[Export ("connectionWithRequest:delegate:")][Static]
NSUrlConnection FromRequest (NSUrlRequest request, [Protocolize] NSUrlConnectionDelegate connectionDelegate);
[Deprecated (PlatformName.iOS, 9,0, message: "Use 'NSUrlSession' instead.")]
[Deprecated (PlatformName.MacOSX, 10,11, message: "Use 'NSUrlSession' instead.")]
[Export ("initWithRequest:delegate:")]
NativeHandle Constructor (NSUrlRequest request, [Protocolize] NSUrlConnectionDelegate connectionDelegate);
[Deprecated (PlatformName.iOS, 9,0, message: "Use 'NSUrlSession' instead.")]
[Deprecated (PlatformName.MacOSX, 10,11, message: "Use 'NSUrlSession' instead.")]
[Export ("initWithRequest:delegate:startImmediately:")]
NativeHandle Constructor (NSUrlRequest request, [Protocolize] NSUrlConnectionDelegate connectionDelegate, bool startImmediately);
[Export ("start")]
void Start ();
[Export ("cancel")]
void Cancel ();
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, NSString forMode);
[Wrap ("Schedule (aRunLoop, forMode.GetConstant ()!)")]
void Schedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[Export ("unscheduleFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, NSString forMode);
[Wrap ("Unschedule (aRunLoop, forMode.GetConstant ()!)")]
void Unschedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[NoMac]
[Export ("originalRequest")]
NSUrlRequest OriginalRequest { get; }
[NoMac]
[Export ("currentRequest")]
NSUrlRequest CurrentRequest { get; }
[Export ("setDelegateQueue:")]
void SetDelegateQueue (NSOperationQueue queue);
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'NSUrlSession.CreateDataTask' instead.")]
[Deprecated (PlatformName.TvOS, 9, 0, message : "Use 'NSUrlSession.CreateDataTask' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 11, message : "Use 'NSUrlSession.CreateDataTask' instead.")]
[NoWatch]
[Static]
[Export ("sendAsynchronousRequest:queue:completionHandler:")]
[Async (ResultTypeName = "NSUrlAsyncResult", MethodName="SendRequestAsync")]
void SendAsynchronousRequest (NSUrlRequest request, NSOperationQueue queue, NSUrlConnectionDataResponse completionHandler);
#if HAS_NEWSSTANDKIT
// Extension from iOS5, NewsstandKit
[Deprecated (PlatformName.iOS, 13,0, message: "Use Background Remote Notifications instead.")]
[NoTV][NoMac][NoMacCatalyst]
[NullAllowed]
[Export ("newsstandAssetDownload", ArgumentSemantic.Weak)]
NewsstandKit.NKAssetDownload NewsstandAssetDownload { get; }
#endif
}
[BaseType (typeof (NSObject), Name="NSURLConnectionDelegate")]
[Model]
[Protocol]
interface NSUrlConnectionDelegate {
[Export ("connection:canAuthenticateAgainstProtectionSpace:")]
[Deprecated (PlatformName.iOS, 8, 0, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 10, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
bool CanAuthenticateAgainstProtectionSpace (NSUrlConnection connection, NSUrlProtectionSpace protectionSpace);
[Export ("connection:didReceiveAuthenticationChallenge:")]
[Deprecated (PlatformName.iOS, 8, 0, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 10, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
void ReceivedAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge);
[Export ("connection:didCancelAuthenticationChallenge:")]
[Deprecated (PlatformName.iOS, 8, 0, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 10, message: "Use 'WillSendRequestForAuthenticationChallenge' instead.")]
void CanceledAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge);
[Export ("connectionShouldUseCredentialStorage:")]
bool ConnectionShouldUseCredentialStorage (NSUrlConnection connection);
[Export ("connection:didFailWithError:")]
void FailedWithError (NSUrlConnection connection, NSError error);
[Export ("connection:willSendRequestForAuthenticationChallenge:")]
void WillSendRequestForAuthenticationChallenge (NSUrlConnection connection, NSUrlAuthenticationChallenge challenge);
}
[BaseType (typeof (NSUrlConnectionDelegate), Name="NSURLConnectionDataDelegate")]
[Protocol, Model]
interface NSUrlConnectionDataDelegate {
[Export ("connection:willSendRequest:redirectResponse:")]
NSUrlRequest WillSendRequest (NSUrlConnection connection, NSUrlRequest request, NSUrlResponse response);
[Export ("connection:didReceiveResponse:")]
void ReceivedResponse (NSUrlConnection connection, NSUrlResponse response);
[Export ("connection:didReceiveData:")]
void ReceivedData (NSUrlConnection connection, NSData data);
[Export ("connection:needNewBodyStream:")]
NSInputStream NeedNewBodyStream (NSUrlConnection connection, NSUrlRequest request);
[Export ("connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:")]
void SentBodyData (NSUrlConnection connection, nint bytesWritten, nint totalBytesWritten, nint totalBytesExpectedToWrite);
[Export ("connection:willCacheResponse:")]
NSCachedUrlResponse WillCacheResponse (NSUrlConnection connection, NSCachedUrlResponse cachedResponse);
[Export ("connectionDidFinishLoading:")]
void FinishedLoading (NSUrlConnection connection);
}
[BaseType (typeof (NSUrlConnectionDelegate), Name="NSURLConnectionDownloadDelegate")]
[Model]
[Protocol]
interface NSUrlConnectionDownloadDelegate {
[Export ("connection:didWriteData:totalBytesWritten:expectedTotalBytes:")]
void WroteData (NSUrlConnection connection, long bytesWritten, long totalBytesWritten, long expectedTotalBytes);
[Export ("connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:")]
void ResumedDownloading (NSUrlConnection connection, long totalBytesWritten, long expectedTotalBytes);
[Abstract]
[Export ("connectionDidFinishDownloading:destinationURL:")]
void FinishedDownloading (NSUrlConnection connection, NSUrl destinationUrl);
}
[BaseType (typeof (NSObject), Name="NSURLCredential")]
// crash when calling NSObjecg.get_Description (and likely other selectors)
[DisableDefaultCtor]
interface NSUrlCredential : NSSecureCoding, NSCopying {
[Export ("initWithTrust:")]
NativeHandle Constructor (SecTrust trust);
[Export ("persistence")]
NSUrlCredentialPersistence Persistence { get; }
[Export ("initWithUser:password:persistence:")]
NativeHandle Constructor (string user, string password, NSUrlCredentialPersistence persistence);
[Static]
[Export ("credentialWithUser:password:persistence:")]
NSUrlCredential FromUserPasswordPersistance (string user, string password, NSUrlCredentialPersistence persistence);
[Export ("user")]
string User { get; }
[Export ("password")]
string Password { get; }
[Export ("hasPassword")]
bool HasPassword {get; }
[Export ("initWithIdentity:certificates:persistence:")]
[Internal]
NativeHandle Constructor (IntPtr identity, IntPtr certificates, NSUrlCredentialPersistence persistance);
[Static]
[Internal]
[Export ("credentialWithIdentity:certificates:persistence:")]
NSUrlCredential FromIdentityCertificatesPersistanceInternal (IntPtr identity, IntPtr certificates, NSUrlCredentialPersistence persistence);
[Internal]
[Export ("identity")]
IntPtr Identity { get; }
[Export ("certificates")]
SecCertificate [] Certificates { get; }
// bound manually to keep the managed/native signatures identical
//[Export ("initWithTrust:")]
//NativeHandle Constructor (IntPtr SecTrustRef_trust, bool ignored);
[Internal]
[Static]
[Export ("credentialForTrust:")]
NSUrlCredential FromTrust (IntPtr trust);
}
[BaseType (typeof (NSObject), Name="NSURLCredentialStorage")]
// init returns NIL -> SharedCredentialStorage
[DisableDefaultCtor]
interface NSUrlCredentialStorage {
[Static]
[Export ("sharedCredentialStorage", ArgumentSemantic.Strong)]
NSUrlCredentialStorage SharedCredentialStorage { get; }
[Export ("credentialsForProtectionSpace:")]
NSDictionary GetCredentials (NSUrlProtectionSpace forProtectionSpace);
[Export ("allCredentials")]
NSDictionary AllCredentials { get; }
[Export ("setCredential:forProtectionSpace:")]
void SetCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
[Export ("removeCredential:forProtectionSpace:")]
void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
[Export ("defaultCredentialForProtectionSpace:")]
NSUrlCredential GetDefaultCredential (NSUrlProtectionSpace forProtectionSpace);
[Export ("setDefaultCredential:forProtectionSpace:")]
void SetDefaultCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace);
[iOS (7,0), Mac (10, 9)]
[Export ("removeCredential:forProtectionSpace:options:")]
void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace forProtectionSpace, NSDictionary options);
[iOS (7,0), Mac (10, 9)]
[Field ("NSURLCredentialStorageRemoveSynchronizableCredentials")]
NSString RemoveSynchronizableCredentials { get; }
[Field ("NSURLCredentialStorageChangedNotification")]
[Notification]
NSString ChangedNotification { get; }
[iOS (8,0), Mac (10,10)]
[Async]
[Export ("getCredentialsForProtectionSpace:task:completionHandler:")]
void GetCredentials (NSUrlProtectionSpace protectionSpace, NSUrlSessionTask task, [NullAllowed] Action<NSDictionary> completionHandler);
[iOS (8,0), Mac (10,10)]
[Export ("setCredential:forProtectionSpace:task:")]
void SetCredential (NSUrlCredential credential, NSUrlProtectionSpace protectionSpace, NSUrlSessionTask task);
[iOS (8,0), Mac (10,10)]
[Export ("removeCredential:forProtectionSpace:options:task:")]
void RemoveCredential (NSUrlCredential credential, NSUrlProtectionSpace protectionSpace, NSDictionary options, NSUrlSessionTask task);
[iOS (8,0), Mac (10,10)]
[Async]
[Export ("getDefaultCredentialForProtectionSpace:task:completionHandler:")]
void GetDefaultCredential (NSUrlProtectionSpace space, NSUrlSessionTask task, [NullAllowed] Action<NSUrlCredential> completionHandler);
[iOS (8,0), Mac (10,10)]
[Export ("setDefaultCredential:forProtectionSpace:task:")]
void SetDefaultCredential (NSUrlCredential credential, NSUrlProtectionSpace protectionSpace, NSUrlSessionTask task);
}
#if NET
delegate void NSUrlSessionPendingTasks (NSUrlSessionTask [] dataTasks, NSUrlSessionTask [] uploadTasks, NSUrlSessionTask[] downloadTasks);
#elif XAMCORE_3_0
delegate void NSUrlSessionPendingTasks2 (NSUrlSessionTask [] dataTasks, NSUrlSessionTask [] uploadTasks, NSUrlSessionTask[] downloadTasks);
#else
delegate void NSUrlSessionPendingTasks (NSUrlSessionDataTask [] dataTasks, NSUrlSessionUploadTask [] uploadTasks, NSUrlSessionDownloadTask[] downloadTasks);
delegate void NSUrlSessionPendingTasks2 (NSUrlSessionTask [] dataTasks, NSUrlSessionTask [] uploadTasks, NSUrlSessionTask[] downloadTasks);
#endif
delegate void NSUrlSessionAllPendingTasks (NSUrlSessionTask [] tasks);
delegate void NSUrlSessionResponse (NSData data, NSUrlResponse response, NSError error);
delegate void NSUrlSessionDownloadResponse (NSUrl data, NSUrlResponse response, NSError error);
delegate void NSUrlDownloadSessionResponse (NSUrl location, NSUrlResponse response, NSError error);
interface INSUrlSessionDelegate {}
//
// Some of the XxxTaskWith methods that take a completion were flagged as allowing a null in
// 083d9cba1eb997eac5c5ded77db32180c3eef566 with comment:
//
// "Add missing [NullAllowed] on NSUrlSession since the
// delegate is optional and the handler can be null when one
// is provided (but requiring a delegate along with handlers
// only duplicates code)"
//
// but Apple has flagged these as not allowing null.
//
// Leaving the null allowed for now.
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSObject), Name="NSURLSession")]
[DisableDefaultCtorAttribute]
partial interface NSUrlSession {
[Static, Export ("sharedSession", ArgumentSemantic.Strong)]
NSUrlSession SharedSession { get; }
[Static, Export ("sessionWithConfiguration:")]
NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration);
[Static, Export ("sessionWithConfiguration:delegate:delegateQueue:")]
NSUrlSession FromWeakConfiguration (NSUrlSessionConfiguration configuration, [NullAllowed] NSObject weakDelegate, [NullAllowed] NSOperationQueue delegateQueue);
#if !NET
[Obsolete ("Use the overload with a 'INSUrlSessionDelegate' parameter.")]
[Static, Wrap ("FromWeakConfiguration (configuration, sessionDelegate, delegateQueue);")]
NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, NSUrlSessionDelegate sessionDelegate, [NullAllowed] NSOperationQueue delegateQueue);
#endif
[Static, Wrap ("FromWeakConfiguration (configuration, (NSObject) sessionDelegate, delegateQueue);")]
NSUrlSession FromConfiguration (NSUrlSessionConfiguration configuration, INSUrlSessionDelegate sessionDelegate, [NullAllowed] NSOperationQueue delegateQueue);
[Export ("delegateQueue", ArgumentSemantic.Retain)]
NSOperationQueue DelegateQueue { get; }
[Export ("delegate", ArgumentSemantic.Retain), NullAllowed]
NSObject WeakDelegate { get; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSUrlSessionDelegate Delegate { get; }
[Export ("configuration", ArgumentSemantic.Copy)]
NSUrlSessionConfiguration Configuration { get; }
[NullAllowed]
[Export ("sessionDescription", ArgumentSemantic.Copy)]
string SessionDescription { get; set; }
[Export ("finishTasksAndInvalidate")]
void FinishTasksAndInvalidate ();
[Export ("invalidateAndCancel")]
void InvalidateAndCancel ();
[Export ("resetWithCompletionHandler:")]
[Async]
void Reset (Action completionHandler);
[Export ("flushWithCompletionHandler:")]
[Async]
void Flush (Action completionHandler);
#if !XAMCORE_3_0
// broken version that we must keep for XAMCORE_3_0 binary compatibility
// but that we do not have to expose on tvOS and watchOS, forcing people to use the correct API
[Obsolete ("Use GetTasks2 instead. This method may throw spurious InvalidCastExceptions, in particular for backgrounded tasks.")]
[Export ("getTasksWithCompletionHandler:")]
[Async (ResultTypeName="NSUrlSessionActiveTasks")]
void GetTasks (NSUrlSessionPendingTasks completionHandler);
#elif NET
// Fixed version (breaking change) only for NET
[Export ("getTasksWithCompletionHandler:")]
[Async (ResultTypeName="NSUrlSessionActiveTasks")]
void GetTasks (NSUrlSessionPendingTasks completionHandler);
#endif
#if !NET
// Workaround, not needed for NET+
[Sealed]
[Export ("getTasksWithCompletionHandler:")]
[Async (ResultTypeName="NSUrlSessionActiveTasks2")]
void GetTasks2 (NSUrlSessionPendingTasks2 completionHandler);
#endif
[Export ("dataTaskWithRequest:")]
[return: ForcedType]
NSUrlSessionDataTask CreateDataTask (NSUrlRequest request);
[Export ("dataTaskWithURL:")]
[return: ForcedType]
NSUrlSessionDataTask CreateDataTask (NSUrl url);
[Export ("uploadTaskWithRequest:fromFile:")]
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSUrl fileURL);
[Export ("uploadTaskWithRequest:fromData:")]
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSData bodyData);
[Export ("uploadTaskWithStreamedRequest:")]
[return: ForcedType]
NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request);
[Export ("downloadTaskWithRequest:")]
[return: ForcedType]
NSUrlSessionDownloadTask CreateDownloadTask (NSUrlRequest request);
[Export ("downloadTaskWithURL:")]
[return: ForcedType]
NSUrlSessionDownloadTask CreateDownloadTask (NSUrl url);
[Export ("downloadTaskWithResumeData:")]
[return: ForcedType]
NSUrlSessionDownloadTask CreateDownloadTask (NSData resumeData);
[Export ("dataTaskWithRequest:completionHandler:")]
[return: ForcedType]
[Async (ResultTypeName="NSUrlSessionDataTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionDataTask CreateDataTask (NSUrlRequest request, [NullAllowed] NSUrlSessionResponse completionHandler);
[Export ("dataTaskWithURL:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDataTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionDataTask CreateDataTask (NSUrl url, [NullAllowed] NSUrlSessionResponse completionHandler);
[Export ("uploadTaskWithRequest:fromFile:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDataTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSUrl fileURL, NSUrlSessionResponse completionHandler);
[Export ("uploadTaskWithRequest:fromData:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDataTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionUploadTask CreateUploadTask (NSUrlRequest request, NSData bodyData, NSUrlSessionResponse completionHandler);
[Export ("downloadTaskWithRequest:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDownloadTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionDownloadTask CreateDownloadTask (NSUrlRequest request, [NullAllowed] NSUrlDownloadSessionResponse completionHandler);
[Export ("downloadTaskWithURL:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDownloadTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionDownloadTask CreateDownloadTask (NSUrl url, [NullAllowed] NSUrlDownloadSessionResponse completionHandler);
[Export ("downloadTaskWithResumeData:completionHandler:")]
[return: ForcedType]
[Async(ResultTypeName="NSUrlSessionDownloadTaskRequest", PostNonResultSnippet = "result.Resume ();")]
NSUrlSessionDownloadTask CreateDownloadTaskFromResumeData (NSData resumeData, [NullAllowed] NSUrlDownloadSessionResponse completionHandler);
[iOS (9,0), Mac(10,11)]
[Export ("getAllTasksWithCompletionHandler:")]
[Async (ResultTypeName="NSUrlSessionCombinedTasks")]
void GetAllTasks (NSUrlSessionAllPendingTasks completionHandler);
[iOS (9,0), Mac(10,11)]
[Export ("streamTaskWithHostName:port:")]
NSUrlSessionStreamTask CreateBidirectionalStream (string hostname, nint port);
[NoWatch]
[iOS (9,0), Mac(10,11)]
[Export ("streamTaskWithNetService:")]
NSUrlSessionStreamTask CreateBidirectionalStream (NSNetService service);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("webSocketTaskWithURL:")]
NSUrlSessionWebSocketTask CreateWebSocketTask (NSUrl url);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("webSocketTaskWithURL:protocols:")]
NSUrlSessionWebSocketTask CreateWebSocketTask (NSUrl url, string[] protocols);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("webSocketTaskWithRequest:")]
NSUrlSessionWebSocketTask CreateWebSocketTask (NSUrlRequest request);
}
[iOS (9,0)]
[Protocol, Model]
[BaseType (typeof (NSUrlSessionTaskDelegate), Name="NSURLSessionStreamDelegate")]
interface NSUrlSessionStreamDelegate
{
[Export ("URLSession:readClosedForStreamTask:")]
void ReadClosed (NSUrlSession session, NSUrlSessionStreamTask streamTask);
[Export ("URLSession:writeClosedForStreamTask:")]
void WriteClosed (NSUrlSession session, NSUrlSessionStreamTask streamTask);
[Export ("URLSession:betterRouteDiscoveredForStreamTask:")]
void BetterRouteDiscovered (NSUrlSession session, NSUrlSessionStreamTask streamTask);
//
// Note: the names of this methods do not exactly match the Objective-C name
// because it was a bad name, and does not describe what this does, so the name
// was picked from the documentation and what it does.
//
[Export ("URLSession:streamTask:didBecomeInputStream:outputStream:")]
void CompletedTaskCaptureStreams (NSUrlSession session, NSUrlSessionStreamTask streamTask, NSInputStream inputStream, NSOutputStream outputStream);
}
delegate void NSUrlSessionDataRead (NSData data, bool atEof, NSError error);
[iOS (9,0), Mac(10,11)]
[BaseType (typeof(NSUrlSessionTask), Name="NSURLSessionStreamTask")]
[DisableDefaultCtor] // now (xcode11) marked as deprecated
interface NSUrlSessionStreamTask
{
[Export ("readDataOfMinLength:maxLength:timeout:completionHandler:")]
[Async (ResultTypeName="NSUrlSessionStreamDataRead")]
void ReadData (nuint minBytes, nuint maxBytes, double timeout, NSUrlSessionDataRead completionHandler);
[Export ("writeData:timeout:completionHandler:")]
[Async]
void WriteData (NSData data, double timeout, Action<NSError> completionHandler);
[Export ("captureStreams")]
void CaptureStreams ();
[Export ("closeWrite")]
void CloseWrite ();
[Export ("closeRead")]
void CloseRead ();
[Export ("startSecureConnection")]
void StartSecureConnection ();
[Deprecated (PlatformName.MacOSX, 10,15, message: "A secure (TLS) connection cannot become drop back to insecure (non-TLS).")]
[Deprecated (PlatformName.iOS, 13,0, message: "A secure (TLS) connection cannot become drop back to insecure (non-TLS).")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "A secure (TLS) connection cannot become drop back to insecure (non-TLS).")]
[Deprecated (PlatformName.TvOS, 13,0, message: "A secure (TLS) connection cannot become drop back to insecure (non-TLS).")]
[Export ("stopSecureConnection")]
void StopSecureConnection ();
}
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSObject), Name="NSURLSessionTask")]
[DisableDefaultCtor]
partial interface NSUrlSessionTask : NSCopying, NSProgressReporting
{
[Deprecated (PlatformName.MacOSX, 10, 15, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "This type is not meant to be user created.")]
[Export ("init")]
NativeHandle Constructor ();
[Export ("taskIdentifier")]
nuint TaskIdentifier { get; }
[Export ("originalRequest", ArgumentSemantic.Copy), NullAllowed]
NSUrlRequest OriginalRequest { get; }
[Export ("currentRequest", ArgumentSemantic.Copy), NullAllowed]
NSUrlRequest CurrentRequest { get; }
[Export ("response", ArgumentSemantic.Copy), NullAllowed]
NSUrlResponse Response { get; }
[Export ("countOfBytesReceived")]
long BytesReceived { get; }
[Export ("countOfBytesSent")]
long BytesSent { get; }
[Export ("countOfBytesExpectedToSend")]
long BytesExpectedToSend { get; }
[Export ("countOfBytesExpectedToReceive")]
long BytesExpectedToReceive { get; }
[NullAllowed] // by default this property is null
[Export ("taskDescription", ArgumentSemantic.Copy)]
string TaskDescription { get; set; }
[Export ("cancel")]
void Cancel ();
[Export ("state")]
NSUrlSessionTaskState State { get; }
[Export ("error", ArgumentSemantic.Copy), NullAllowed]
NSError Error { get; }
[Export ("suspend")]
void Suspend ();
[Export ("resume")]
void Resume ();
[Field ("NSURLSessionTransferSizeUnknown")]
long TransferSizeUnknown { get; }
[iOS (8,0), Mac (10,10)]
[Export ("priority")]
float Priority { get; set; } /* float, not CGFloat */
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[Export ("prefersIncrementalDelivery")]
bool PrefersIncrementalDelivery { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("earliestBeginDate", ArgumentSemantic.Copy)]
NSDate EarliestBeginDate { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Export ("countOfBytesClientExpectsToSend")]
long CountOfBytesClientExpectsToSend { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Export ("countOfBytesClientExpectsToReceive")]
long CountOfBytesClientExpectsToReceive { get; set; }
}
[Static]
[iOS (8,0)]
[Mac (10,10)]
interface NSUrlSessionTaskPriority {
[Field ("NSURLSessionTaskPriorityDefault")]
float Default { get; } /* float, not CGFloat */
[Field ("NSURLSessionTaskPriorityLow")]
float Low { get; } /* float, not CGFloat */
[Field ("NSURLSessionTaskPriorityHigh")]
float High { get; } /* float, not CGFloat */
}
// All of the NSUrlSession APIs are either 10.10, or 10.9 and 64-bit only
// "NSURLSession is not available for i386 targets before Mac OS X 10.10."
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSUrlSessionTask), Name="NSURLSessionDataTask")]
[DisableDefaultCtor]
partial interface NSUrlSessionDataTask {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'NSURLSession.CreateDataTask' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'NSURLSession.CreateDataTask' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'NSURLSession.CreateDataTask' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'NSURLSession.CreateDataTask' instead.")]
[Export ("init")]
NativeHandle Constructor ();
}
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSUrlSessionDataTask), Name="NSURLSessionUploadTask")]
[DisableDefaultCtor]
partial interface NSUrlSessionUploadTask {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'NSURLSession.CreateUploadTask' instead.")]
[Export ("init")]
NativeHandle Constructor ();
}
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSUrlSessionTask), Name="NSURLSessionDownloadTask")]
[DisableDefaultCtor]
partial interface NSUrlSessionDownloadTask {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'NSURLSession.CreateDownloadTask' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'NSURLSession.CreateDownloadTask' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'NSURLSession.CreateDownloadTask' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'NSURLSession.CreateDownloadTask' instead.")]
[Export ("init")]
NativeHandle Constructor ();
[Export ("cancelByProducingResumeData:")]
void Cancel (Action<NSData> resumeCallback);
}
[Internal]
[Static]
[NoWatch]
interface ProxyConfigurationDictionaryKeys {
[Field ("kCFNetworkProxiesHTTPEnable")]
NSString HttpEnableKey { get; }
[Field ("kCFStreamPropertyHTTPProxyHost")]
NSString HttpProxyHostKey { get; }
[Field ("kCFStreamPropertyHTTPProxyPort")]
NSString HttpProxyPortKey { get; }
[NoiOS, NoTV]
[Field ("kCFNetworkProxiesHTTPSEnable")]
NSString HttpsEnableKey { get; }
[Field ("kCFStreamPropertyHTTPSProxyHost")]
NSString HttpsProxyHostKey { get; }
[Field ("kCFStreamPropertyHTTPSProxyPort")]
NSString HttpsProxyPortKey { get; }
}
[NoWatch]
[StrongDictionary ("ProxyConfigurationDictionaryKeys")]
interface ProxyConfigurationDictionary {
bool HttpEnable { get; set; }
string HttpProxyHost { get; set; }
int HttpProxyPort { get; set;}
[NoiOS, NoTV]
bool HttpsEnable { get; set; }
string HttpsProxyHost { get; set;}
int HttpsProxyPort { get; set; }
}
[iOS (7,0)]
[Mac (10, 9)]
[BaseType (typeof (NSObject), Name="NSURLSessionConfiguration")]
[DisableDefaultCtorAttribute]
partial interface NSUrlSessionConfiguration : NSCopying {
[Internal]
[Static, Export ("defaultSessionConfiguration", ArgumentSemantic.Strong)]
NSUrlSessionConfiguration _DefaultSessionConfiguration { get; }
[Internal]
[Static, Export ("ephemeralSessionConfiguration", ArgumentSemantic.Strong)]
NSUrlSessionConfiguration _EphemeralSessionConfiguration { get; }
[Internal]
[Static, Export ("backgroundSessionConfiguration:")]
NSUrlSessionConfiguration _BackgroundSessionConfiguration (string identifier);
[Export ("identifier", ArgumentSemantic.Copy), NullAllowed]
string Identifier { get; }
[Export ("requestCachePolicy")]
NSUrlRequestCachePolicy RequestCachePolicy { get; set; }
[Export ("timeoutIntervalForRequest")]
double TimeoutIntervalForRequest { get; set; }
[Export ("timeoutIntervalForResource")]
double TimeoutIntervalForResource { get; set; }
[Export ("networkServiceType")]
NSUrlRequestNetworkServiceType NetworkServiceType { get; set; }
[Export ("allowsCellularAccess")]
bool AllowsCellularAccess { get; set; }
[Export ("discretionary")]
bool Discretionary { [Bind ("isDiscretionary")] get; set; }
[Mac (11,0)]
[Export ("sessionSendsLaunchEvents")]
bool SessionSendsLaunchEvents { get; set; }
[NullAllowed]
[Export ("connectionProxyDictionary", ArgumentSemantic.Copy)]
NSDictionary ConnectionProxyDictionary { get; set; }
[NoWatch]
ProxyConfigurationDictionary StrongConnectionProxyDictionary {
[Wrap ("new ProxyConfigurationDictionary (ConnectionProxyDictionary!)")]
get;
[Wrap ("ConnectionProxyDictionary = value.GetDictionary ()")]
set;
}
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'TlsMinimumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'TlsMinimumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'TlsMinimumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'TlsMinimumSupportedProtocolVersion' instead.")]
[Export ("TLSMinimumSupportedProtocol")]
SslProtocol TLSMinimumSupportedProtocol { get; set; }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("TLSMinimumSupportedProtocolVersion", ArgumentSemantic.Assign)]
TlsProtocolVersion TlsMinimumSupportedProtocolVersion { get; set; }
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'TlsMaximumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'TlsMaximumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'TlsMaximumSupportedProtocolVersion' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'TlsMaximumSupportedProtocolVersion' instead.")]
[Export ("TLSMaximumSupportedProtocol")]
SslProtocol TLSMaximumSupportedProtocol { get; set; }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("TLSMaximumSupportedProtocolVersion", ArgumentSemantic.Assign)]
TlsProtocolVersion TlsMaximumSupportedProtocolVersion { get; set; }
[Export ("HTTPShouldUsePipelining")]
bool HttpShouldUsePipelining { get; set; }
[Export ("HTTPShouldSetCookies")]
bool HttpShouldSetCookies { get; set; }
[Export ("HTTPCookieAcceptPolicy")]
NSHttpCookieAcceptPolicy HttpCookieAcceptPolicy { get; set; }
[NullAllowed]
[Export ("HTTPAdditionalHeaders", ArgumentSemantic.Copy)]
NSDictionary HttpAdditionalHeaders { get; set; }
[Export ("HTTPMaximumConnectionsPerHost")]
nint HttpMaximumConnectionsPerHost { get; set; }
[NullAllowed]
[Export ("HTTPCookieStorage", ArgumentSemantic.Retain)]
NSHttpCookieStorage HttpCookieStorage { get; set; }
[NullAllowed]
[Export ("URLCredentialStorage", ArgumentSemantic.Retain)]
NSUrlCredentialStorage URLCredentialStorage { get; set; }
[NullAllowed]
[Export ("URLCache", ArgumentSemantic.Retain)]
NSUrlCache URLCache { get; set; }
[NullAllowed]
[Export ("protocolClasses", ArgumentSemantic.Copy)]
NSArray WeakProtocolClasses { get; set; }
[NullAllowed]
[iOS (8,0), Mac (10,10)]
[Export ("sharedContainerIdentifier")]
string SharedContainerIdentifier { get; set; }
[Internal]
[iOS (8,0)]
[Static, Export ("backgroundSessionConfigurationWithIdentifier:")]
NSUrlSessionConfiguration _CreateBackgroundSessionConfiguration (string identifier);
[iOS (9,0), Mac(10,11)]
[Export ("shouldUseExtendedBackgroundIdleMode")]
bool ShouldUseExtendedBackgroundIdleMode { get; set; }
[NoWatch, NoTV, NoMac, iOS (11, 0)]
[Export ("multipathServiceType", ArgumentSemantic.Assign)]
NSUrlSessionMultipathServiceType MultipathServiceType { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[Export ("waitsForConnectivity")]
bool WaitsForConnectivity { get; set; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsExpensiveNetworkAccess")]
bool AllowsExpensiveNetworkAccess { get; set; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsConstrainedNetworkAccess")]
bool AllowsConstrainedNetworkAccess { get; set; }
}
[iOS (7,0)]
[Mac (10, 9)]
[Model, BaseType (typeof (NSObject), Name="NSURLSessionDelegate")]
[Protocol]
partial interface NSUrlSessionDelegate {
[Export ("URLSession:didBecomeInvalidWithError:")]
void DidBecomeInvalid (NSUrlSession session, NSError error);
[Export ("URLSession:didReceiveChallenge:completionHandler:")]
void DidReceiveChallenge (NSUrlSession session, NSUrlAuthenticationChallenge challenge, Action<NSUrlSessionAuthChallengeDisposition,NSUrlCredential> completionHandler);
[Mac (11,0)]
[Export ("URLSessionDidFinishEventsForBackgroundURLSession:")]
void DidFinishEventsForBackgroundSession (NSUrlSession session);
}
[iOS (7,0)]
[Mac (10, 9)]
[Model]
[BaseType (typeof (NSUrlSessionDelegate), Name="NSURLSessionTaskDelegate")]
[Protocol]
partial interface NSUrlSessionTaskDelegate {
[Export ("URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:")]
void WillPerformHttpRedirection (NSUrlSession session, NSUrlSessionTask task, NSHttpUrlResponse response, NSUrlRequest newRequest, Action<NSUrlRequest> completionHandler);
[Export ("URLSession:task:didReceiveChallenge:completionHandler:")]
void DidReceiveChallenge (NSUrlSession session, NSUrlSessionTask task, NSUrlAuthenticationChallenge challenge, Action<NSUrlSessionAuthChallengeDisposition,NSUrlCredential> completionHandler);
[Export ("URLSession:task:needNewBodyStream:")]
void NeedNewBodyStream (NSUrlSession session, NSUrlSessionTask task, Action<NSInputStream> completionHandler);
[Export ("URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:")]
void DidSendBodyData (NSUrlSession session, NSUrlSessionTask task, long bytesSent, long totalBytesSent, long totalBytesExpectedToSend);
[Export ("URLSession:task:didCompleteWithError:")]
void DidCompleteWithError (NSUrlSession session, NSUrlSessionTask task, [NullAllowed] NSError error);
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("URLSession:task:didFinishCollectingMetrics:")]
void DidFinishCollectingMetrics (NSUrlSession session, NSUrlSessionTask task, NSUrlSessionTaskMetrics metrics);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("URLSession:task:willBeginDelayedRequest:completionHandler:")]
void WillBeginDelayedRequest (NSUrlSession session, NSUrlSessionTask task, NSUrlRequest request, Action<NSUrlSessionDelayedRequestDisposition, NSUrlRequest> completionHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("URLSession:taskIsWaitingForConnectivity:")]
void TaskIsWaitingForConnectivity (NSUrlSession session, NSUrlSessionTask task);
}
[iOS (7,0)]
[Mac (10, 9)]
[Model]
[BaseType (typeof (NSUrlSessionTaskDelegate), Name="NSURLSessionDataDelegate")]
[Protocol]
partial interface NSUrlSessionDataDelegate {
[Export ("URLSession:dataTask:didReceiveResponse:completionHandler:")]
void DidReceiveResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlResponse response, Action<NSUrlSessionResponseDisposition> completionHandler);
[Export ("URLSession:dataTask:didBecomeDownloadTask:")]
void DidBecomeDownloadTask (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlSessionDownloadTask downloadTask);
[Export ("URLSession:dataTask:didReceiveData:")]
void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask dataTask, NSData data);
[Export ("URLSession:dataTask:willCacheResponse:completionHandler:")]
void WillCacheResponse (NSUrlSession session, NSUrlSessionDataTask dataTask, NSCachedUrlResponse proposedResponse, Action<NSCachedUrlResponse> completionHandler);
[iOS(9,0), Mac(10,11)]
[Export ("URLSession:dataTask:didBecomeStreamTask:")]
void DidBecomeStreamTask (NSUrlSession session, NSUrlSessionDataTask dataTask, NSUrlSessionStreamTask streamTask);
}
[iOS (7,0)]
[Mac (10, 9)]
[Model]
[BaseType (typeof (NSUrlSessionTaskDelegate), Name="NSURLSessionDownloadDelegate")]
[Protocol]
partial interface NSUrlSessionDownloadDelegate {
[Abstract]
[Export ("URLSession:downloadTask:didFinishDownloadingToURL:")]
void DidFinishDownloading (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, NSUrl location);
[Export ("URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:")]
void DidWriteData (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, long bytesWritten, long totalBytesWritten, long totalBytesExpectedToWrite);
[Export ("URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:")]
void DidResume (NSUrlSession session, NSUrlSessionDownloadTask downloadTask, long resumeFileOffset, long expectedTotalBytes);
[Field ("NSURLSessionDownloadTaskResumeData")]
NSString TaskResumeDataKey { get; }
}
interface NSUndoManagerCloseUndoGroupEventArgs {
// Bug in docs, see header file
[Export ("NSUndoManagerGroupIsDiscardableKey")]
[NullAllowed]
bool Discardable { get; }
}
[BaseType (typeof (NSObject))]
interface NSUndoManager {
[Export ("beginUndoGrouping")]
void BeginUndoGrouping ();
[Export ("endUndoGrouping")]
void EndUndoGrouping ();
[Export ("groupingLevel")]
nint GroupingLevel { get; }
[Export ("disableUndoRegistration")]
void DisableUndoRegistration ();
[Export ("enableUndoRegistration")]
void EnableUndoRegistration ();
[Export ("isUndoRegistrationEnabled")]
bool IsUndoRegistrationEnabled { get; }
[Export ("groupsByEvent")]
bool GroupsByEvent { get; set; }
[Export ("levelsOfUndo")]
nint LevelsOfUndo { get; set; }
#if NET
[Export ("runLoopModes", ArgumentSemantic.Copy)]
NSString [] WeakRunLoopModes { get; set; }
#else
[Export ("runLoopModes")]
string [] RunLoopModes { get; set; }
#endif
[Export ("undo")]
void Undo ();
[Export ("redo")]
void Redo ();
[Export ("undoNestedGroup")]
void UndoNestedGroup ();
[Export ("canUndo")]
bool CanUndo { get; }
[Export ("canRedo")]
bool CanRedo { get; }
[Export ("isUndoing")]
bool IsUndoing { get; }
[Export ("isRedoing")]
bool IsRedoing { get; }
[Export ("removeAllActions")]
void RemoveAllActions ();
[Export ("removeAllActionsWithTarget:")]
void RemoveAllActions (NSObject target);
[Export ("registerUndoWithTarget:selector:object:")]
void RegisterUndoWithTarget (NSObject target, Selector selector, [NullAllowed] NSObject anObject);
[Export ("prepareWithInvocationTarget:")]
NSObject PrepareWithInvocationTarget (NSObject target);
[Export ("undoActionName")]
string UndoActionName { get; }
[Export ("redoActionName")]
string RedoActionName { get; }
#if NET
[Export ("setActionName:")]
void SetActionName (string actionName);
#else
[Advice ("Use the correctly named method: 'SetActionName'.")]
[Export ("setActionName:")]
void SetActionname (string actionName);
#endif
[Export ("undoMenuItemTitle")]
string UndoMenuItemTitle { get; }
[Export ("redoMenuItemTitle")]
string RedoMenuItemTitle { get; }
[Export ("undoMenuTitleForUndoActionName:")]
string UndoMenuTitleForUndoActionName (string name);
[Export ("redoMenuTitleForUndoActionName:")]
string RedoMenuTitleForUndoActionName (string name);
[Field ("NSUndoManagerCheckpointNotification")]
[Notification]
NSString CheckpointNotification { get; }
[Field ("NSUndoManagerDidOpenUndoGroupNotification")]
[Notification]
NSString DidOpenUndoGroupNotification { get; }
[Field ("NSUndoManagerDidRedoChangeNotification")]
[Notification]
NSString DidRedoChangeNotification { get; }
[Field ("NSUndoManagerDidUndoChangeNotification")]
[Notification]
NSString DidUndoChangeNotification { get; }
[Field ("NSUndoManagerWillCloseUndoGroupNotification")]
[Notification (typeof (NSUndoManagerCloseUndoGroupEventArgs))]
NSString WillCloseUndoGroupNotification { get; }
[Field ("NSUndoManagerWillRedoChangeNotification")]
[Notification]
NSString WillRedoChangeNotification { get; }
[Field ("NSUndoManagerWillUndoChangeNotification")]
[Notification]
NSString WillUndoChangeNotification { get; }
[Export ("setActionIsDiscardable:")]
void SetActionIsDiscardable (bool discardable);
[Export ("undoActionIsDiscardable")]
bool UndoActionIsDiscardable { get; }
[Export ("redoActionIsDiscardable")]
bool RedoActionIsDiscardable { get; }
[Field ("NSUndoManagerGroupIsDiscardableKey")]
NSString GroupIsDiscardableKey { get; }
[Field ("NSUndoManagerDidCloseUndoGroupNotification")]
[Notification (typeof (NSUndoManagerCloseUndoGroupEventArgs))]
NSString DidCloseUndoGroupNotification { get; }
[iOS (9,0), Mac(10,11)]
[Export ("registerUndoWithTarget:handler:")]
void RegisterUndo (NSObject target, Action<NSObject> undoHandler);
}
[BaseType (typeof (NSObject), Name="NSURLProtectionSpace")]
// 'init' returns NIL
[DisableDefaultCtor]
interface NSUrlProtectionSpace : NSSecureCoding, NSCopying {
[Internal]
[Export ("initWithHost:port:protocol:realm:authenticationMethod:")]
IntPtr Init (string host, nint port, [NullAllowed] string protocol, [NullAllowed] string realm, [NullAllowed] string authenticationMethod);
[Internal]
[Export ("initWithProxyHost:port:type:realm:authenticationMethod:")]
IntPtr InitWithProxy (string host, nint port, [NullAllowed] string type, [NullAllowed] string realm, [NullAllowed] string authenticationMethod);
[Export ("realm")]
string Realm { get; }
[Export ("receivesCredentialSecurely")]
bool ReceivesCredentialSecurely { get; }
[Export ("isProxy")]
bool IsProxy { get; }
[Export ("host")]
string Host { get; }
[Export ("port")]
nint Port { get; }
[Export ("proxyType")]
string ProxyType { get; }
[Export ("protocol")]
string Protocol { get; }
[Export ("authenticationMethod")]
string AuthenticationMethod { get; }
// NSURLProtectionSpace(NSClientCertificateSpace)
[Export ("distinguishedNames")]
NSData [] DistinguishedNames { get; }
// NSURLProtectionSpace(NSServerTrustValidationSpace)
[Internal]
[Export ("serverTrust")]
IntPtr ServerTrust { get ; }
[Field ("NSURLProtectionSpaceHTTP")]
NSString HTTP { get; }
[Field ("NSURLProtectionSpaceHTTPS")]
NSString HTTPS { get; }
[Field ("NSURLProtectionSpaceFTP")]
NSString FTP { get; }
[Field ("NSURLProtectionSpaceHTTPProxy")]
NSString HTTPProxy { get; }
[Field ("NSURLProtectionSpaceHTTPSProxy")]
NSString HTTPSProxy { get; }
[Field ("NSURLProtectionSpaceFTPProxy")]
NSString FTPProxy { get; }
[Field ("NSURLProtectionSpaceSOCKSProxy")]
NSString SOCKSProxy { get; }
[Field ("NSURLAuthenticationMethodDefault")]
NSString AuthenticationMethodDefault { get; }
[Field ("NSURLAuthenticationMethodHTTPBasic")]
NSString AuthenticationMethodHTTPBasic { get; }
[Field ("NSURLAuthenticationMethodHTTPDigest")]
NSString AuthenticationMethodHTTPDigest { get; }
[Field ("NSURLAuthenticationMethodHTMLForm")]
NSString AuthenticationMethodHTMLForm { get; }
[Field ("NSURLAuthenticationMethodNTLM")]
NSString AuthenticationMethodNTLM { get; }
[Field ("NSURLAuthenticationMethodNegotiate")]
NSString AuthenticationMethodNegotiate { get; }
[Field ("NSURLAuthenticationMethodClientCertificate")]
NSString AuthenticationMethodClientCertificate { get; }
[Field ("NSURLAuthenticationMethodServerTrust")]
NSString AuthenticationMethodServerTrust { get; }
}
[BaseType (typeof (NSObject), Name="NSURLRequest")]
interface NSUrlRequest : NSSecureCoding, NSMutableCopying {
[Export ("initWithURL:")]
NativeHandle Constructor (NSUrl url);
[DesignatedInitializer]
[Export ("initWithURL:cachePolicy:timeoutInterval:")]
NativeHandle Constructor (NSUrl url, NSUrlRequestCachePolicy cachePolicy, double timeoutInterval);
[Export ("requestWithURL:")][Static]
NSUrlRequest FromUrl (NSUrl url);
[Export ("URL")]
NSUrl Url { get; }
[Export ("cachePolicy")]
NSUrlRequestCachePolicy CachePolicy { get; }
[Export ("timeoutInterval")]
double TimeoutInterval { get; }
[Export ("mainDocumentURL")]
NSUrl MainDocumentURL { get; }
[Export ("networkServiceType")]
NSUrlRequestNetworkServiceType NetworkServiceType { get; }
[Export ("allowsCellularAccess")]
bool AllowsCellularAccess { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsExpensiveNetworkAccess")]
bool AllowsExpensiveNetworkAccess { get; [NotImplemented] set; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsConstrainedNetworkAccess")]
bool AllowsConstrainedNetworkAccess { get; [NotImplemented] set; }
[Export ("HTTPMethod")]
string HttpMethod { get; }
[Export ("allHTTPHeaderFields")]
NSDictionary Headers { get; }
[Internal][Export ("valueForHTTPHeaderField:")]
string Header (string field);
[Export ("HTTPBody")]
NSData Body { get; }
[Export ("HTTPBodyStream")]
NSInputStream BodyStream { get; }
[Export ("HTTPShouldHandleCookies")]
bool ShouldHandleCookies { get; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[MacCatalyst (14,5)]
[Export ("assumesHTTP3Capable")]
bool AssumesHttp3Capable { get; [NotImplemented] set; }
}
[BaseType (typeof (NSDictionary))]
[DesignatedDefaultCtor]
interface NSMutableDictionary {
[Export ("dictionaryWithContentsOfFile:")]
[Static]
NSMutableDictionary FromFile (string path);
[Export ("dictionaryWithContentsOfURL:")]
[Static]
NSMutableDictionary FromUrl (NSUrl url);
[Export ("dictionaryWithObject:forKey:")]
[Static]
NSMutableDictionary FromObjectAndKey (NSObject obj, NSObject key);
[Export ("dictionaryWithDictionary:")]
[Static,New]
NSMutableDictionary FromDictionary (NSDictionary source);
[Export ("dictionaryWithObjects:forKeys:count:")]
[Static, Internal]
NSMutableDictionary FromObjectsAndKeysInternalCount (NSArray objects, NSArray keys, nint count);
[Export ("dictionaryWithObjects:forKeys:")]
[Static, Internal, New]
NSMutableDictionary FromObjectsAndKeysInternal (NSArray objects, NSArray Keys);
[Export ("initWithDictionary:")]
NativeHandle Constructor (NSDictionary other);
[Export ("initWithDictionary:copyItems:")]
NativeHandle Constructor (NSDictionary other, bool copyItems);
[Export ("initWithContentsOfFile:")]
NativeHandle Constructor (string fileName);
[Export ("initWithContentsOfURL:")]
NativeHandle Constructor (NSUrl url);
[Internal]
[Export ("initWithObjects:forKeys:")]
NativeHandle Constructor (NSArray objects, NSArray keys);
[Export ("removeAllObjects"), Internal]
void RemoveAllObjects ();
[Sealed]
[Internal]
[Export ("removeObjectForKey:")]
void _RemoveObjectForKey (IntPtr key);
[Export ("removeObjectForKey:"), Internal]
void RemoveObjectForKey (NSObject key);
[Sealed]
[Internal]
[Export ("setObject:forKey:")]
void _SetObject (IntPtr obj, IntPtr key);
[Export ("setObject:forKey:"), Internal]
void SetObject (NSObject obj, NSObject key);
[Static]
[Export ("dictionaryWithSharedKeySet:")]
NSDictionary FromSharedKeySet (NSObject sharedKeyToken);
[Export ("addEntriesFromDictionary:")]
void AddEntries (NSDictionary other);
}
interface NSMutableDictionary<K,V> : NSDictionary {}
[BaseType (typeof (NSSet))]
[DesignatedDefaultCtor]
interface NSMutableSet {
[Export ("initWithArray:")]
NativeHandle Constructor (NSArray other);
[Export ("initWithSet:")]
NativeHandle Constructor (NSSet other);
[DesignatedInitializer]
[Export ("initWithCapacity:")]
NativeHandle Constructor (nint capacity);
[Internal]
[Sealed]
[Export ("addObject:")]
void _Add (IntPtr obj);
[Export ("addObject:")]
void Add (NSObject nso);
[Internal]
[Sealed]
[Export ("removeObject:")]
void _Remove (IntPtr nso);
[Export ("removeObject:")]
void Remove (NSObject nso);
[Export ("removeAllObjects")]
void RemoveAll ();
[Internal]
[Sealed]
[Export ("addObjectsFromArray:")]
void _AddObjects (IntPtr objects);
[Export ("addObjectsFromArray:")]
void AddObjects (NSObject [] objects);
[Internal, Export ("minusSet:")]
void MinusSet (NSSet other);
[Internal, Export ("unionSet:")]
void UnionSet (NSSet other);
}
[BaseType (typeof (NSUrlRequest), Name="NSMutableURLRequest")]
interface NSMutableUrlRequest {
[Export ("initWithURL:")]
NativeHandle Constructor (NSUrl url);
[Export ("initWithURL:cachePolicy:timeoutInterval:")]
NativeHandle Constructor (NSUrl url, NSUrlRequestCachePolicy cachePolicy, double timeoutInterval);
[NullAllowed] // by default this property is null
[New][Export ("URL")]
NSUrl Url { get; set; }
[New][Export ("cachePolicy")]
NSUrlRequestCachePolicy CachePolicy { get; set; }
[New][Export ("timeoutInterval")]
double TimeoutInterval { set; get; }
[NullAllowed] // by default this property is null
[New][Export ("mainDocumentURL")]
NSUrl MainDocumentURL { get; set; }
[New][Export ("HTTPMethod")]
string HttpMethod { get; set; }
[NullAllowed] // by default this property is null
[New][Export ("allHTTPHeaderFields")]
NSDictionary Headers { get; set; }
[Internal][Export ("setValue:forHTTPHeaderField:")]
void _SetValue (string value, string field);
[NullAllowed] // by default this property is null
[New][Export ("HTTPBody")]
NSData Body { get; set; }
[NullAllowed] // by default this property is null
[New][Export ("HTTPBodyStream")]
NSInputStream BodyStream { get; set; }
[New][Export ("HTTPShouldHandleCookies")]
bool ShouldHandleCookies { get; set; }
[Export ("networkServiceType")]
NSUrlRequestNetworkServiceType NetworkServiceType { set; get; }
[New] [Export ("allowsCellularAccess")]
bool AllowsCellularAccess { get; set; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsExpensiveNetworkAccess")]
bool AllowsExpensiveNetworkAccess { get; set; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("allowsConstrainedNetworkAccess")]
bool AllowsConstrainedNetworkAccess { get; set; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[MacCatalyst (14,5)]
[Export ("assumesHTTP3Capable")]
bool AssumesHttp3Capable { get; set; }
}
[BaseType (typeof (NSObject), Name="NSURLResponse")]
interface NSUrlResponse : NSSecureCoding, NSCopying {
[DesignatedInitializer]
[Export ("initWithURL:MIMEType:expectedContentLength:textEncodingName:")]
NativeHandle Constructor (NSUrl url, string mimetype, nint expectedContentLength, [NullAllowed] string textEncodingName);
[Export ("URL")]
NSUrl Url { get; }
[Export ("MIMEType")]
string MimeType { get; }
[Export ("expectedContentLength")]
long ExpectedContentLength { get; }
[Export ("textEncodingName")]
string TextEncodingName { get; }
[Export ("suggestedFilename")]
string SuggestedFilename { get; }
}
[BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] { typeof (NSStreamDelegate)} )]
interface NSStream {
[Export ("open")]
void Open ();
[Export ("close")]
void Close ();
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSStreamDelegate Delegate { get; set; }
#if NET
[Abstract]
#endif
[return: NullAllowed]
[Protected]
[Export ("propertyForKey:")]
NSObject GetProperty (NSString key);
#if NET
[Abstract]
#endif
[Protected]
[Export ("setProperty:forKey:")]
bool SetProperty ([NullAllowed] NSObject property, NSString key);
#if NET
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, NSString mode);
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, NSString mode);
#else
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, string mode);
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, string mode);
#endif
[Wrap ("Schedule (aRunLoop, mode.GetConstant ()!)")]
void Schedule (NSRunLoop aRunLoop, NSRunLoopMode mode);
[Wrap ("Unschedule (aRunLoop, mode.GetConstant ()!)")]
void Unschedule (NSRunLoop aRunLoop, NSRunLoopMode mode);
[Export ("streamStatus")]
NSStreamStatus Status { get; }
[Export ("streamError")]
NSError Error { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelKey")]
NSString SocketSecurityLevelKey { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelNone")]
NSString SocketSecurityLevelNone { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelSSLv2")]
NSString SocketSecurityLevelSslV2 { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelSSLv3")]
NSString SocketSecurityLevelSslV3 { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelTLSv1")]
NSString SocketSecurityLevelTlsV1 { get; }
[Advanced, Field ("NSStreamSocketSecurityLevelNegotiatedSSL")]
NSString SocketSecurityLevelNegotiatedSsl { get; }
[Advanced, Field ("NSStreamSOCKSProxyConfigurationKey")]
NSString SocksProxyConfigurationKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyHostKey")]
NSString SocksProxyHostKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyPortKey")]
NSString SocksProxyPortKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyVersionKey")]
NSString SocksProxyVersionKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyUserKey")]
NSString SocksProxyUserKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyPasswordKey")]
NSString SocksProxyPasswordKey { get; }
[Advanced, Field ("NSStreamSOCKSProxyVersion4")]
NSString SocksProxyVersion4 { get; }
[Advanced, Field ("NSStreamSOCKSProxyVersion5")]
NSString SocksProxyVersion5 { get; }
[Advanced, Field ("NSStreamDataWrittenToMemoryStreamKey")]
NSString DataWrittenToMemoryStreamKey { get; }
[Advanced, Field ("NSStreamFileCurrentOffsetKey")]
NSString FileCurrentOffsetKey { get; }
[Advanced, Field ("NSStreamSocketSSLErrorDomain")]
NSString SocketSslErrorDomain { get; }
[Advanced, Field ("NSStreamSOCKSErrorDomain")]
NSString SocksErrorDomain { get; }
[Advanced, Field ("NSStreamNetworkServiceType")]
NSString NetworkServiceType { get; }
[Advanced, Field ("NSStreamNetworkServiceTypeVoIP")]
NSString NetworkServiceTypeVoIP { get; }
[Advanced, Field ("NSStreamNetworkServiceTypeVideo")]
NSString NetworkServiceTypeVideo { get; }
[Advanced, Field ("NSStreamNetworkServiceTypeBackground")]
NSString NetworkServiceTypeBackground { get; }
[Advanced, Field ("NSStreamNetworkServiceTypeVoice")]
NSString NetworkServiceTypeVoice { get; }
[Advanced]
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Field ("NSStreamNetworkServiceTypeCallSignaling")]
NSString NetworkServiceTypeCallSignaling { get; }
[iOS (8,0), Mac(10,10)]
[Static, Export ("getBoundStreamsWithBufferSize:inputStream:outputStream:")]
void GetBoundStreams (nuint bufferSize, out NSInputStream inputStream, out NSOutputStream outputStream);
[NoWatch]
[iOS (8,0), Mac (10,10)]
[Static, Export ("getStreamsToHostWithName:port:inputStream:outputStream:")]
void GetStreamsToHost (string hostname, nint port, out NSInputStream inputStream, out NSOutputStream outputStream);
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSStreamDelegate {
[Export ("stream:handleEvent:"), EventArgs ("NSStream"), EventName ("OnEvent")]
void HandleEvent (NSStream theStream, NSStreamEvent streamEvent);
}
[BaseType (typeof (NSObject)), Bind ("NSString")]
[DesignatedDefaultCtor]
interface NSString2 : NSSecureCoding, NSMutableCopying, CKRecordValue
#if MONOMAC
, NSPasteboardReading, NSPasteboardWriting // Documented that it implements NSPasteboard protocols even if header doesn't show it
#endif
, NSItemProviderReading, NSItemProviderWriting
{
[Export ("initWithData:encoding:")]
NativeHandle Constructor (NSData data, NSStringEncoding encoding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Bind ("sizeWithAttributes:")]
CGSize StringSize ([NullAllowed] NSDictionary attributedStringAttributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Bind ("boundingRectWithSize:options:attributes:")]
CGRect BoundingRectWithSize (CGSize size, NSStringDrawingOptions options, NSDictionary attributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Bind ("drawAtPoint:withAttributes:")]
void DrawString (CGPoint point, NSDictionary attributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Bind ("drawInRect:withAttributes:")]
void DrawString (CGRect rect, NSDictionary attributes);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Bind ("drawWithRect:options:attributes:")]
void DrawString (CGRect rect, NSStringDrawingOptions options, NSDictionary attributes);
[Internal]
[Export ("characterAtIndex:")]
char _characterAtIndex (nint index);
[Export ("length")]
nint Length {get;}
[Sealed]
[Export ("isEqualToString:")]
bool IsEqualTo (IntPtr handle);
[Export ("compare:")]
NSComparisonResult Compare (NSString aString);
[Export ("compare:options:")]
NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask);
[Export ("compare:options:range:")]
NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask, NSRange range);
[Export ("compare:options:range:locale:")]
NSComparisonResult Compare (NSString aString, NSStringCompareOptions mask, NSRange range, [NullAllowed] NSLocale locale);
[Export ("stringByReplacingCharactersInRange:withString:")]
NSString Replace (NSRange range, NSString replacement);
[Export ("commonPrefixWithString:options:")]
NSString CommonPrefix (NSString aString, NSStringCompareOptions options);
// start methods from NSStringPathExtensions category
[Static]
[Export("pathWithComponents:")]
string[] PathWithComponents( string[] components );
[Export("pathComponents")]
string[] PathComponents { get; }
[Export("isAbsolutePath")]
bool IsAbsolutePath { get; }
[Export("lastPathComponent")]
NSString LastPathComponent { get; }
[Export("stringByDeletingLastPathComponent")]
NSString DeleteLastPathComponent();
[Export("stringByAppendingPathComponent:")]
NSString AppendPathComponent( NSString str );
[Export("pathExtension")]
NSString PathExtension { get; }
[Export("stringByDeletingPathExtension")]
NSString DeletePathExtension();
[Export("stringByAppendingPathExtension:")]
NSString AppendPathExtension( NSString str );
[Export("stringByAbbreviatingWithTildeInPath")]
NSString AbbreviateTildeInPath();
[Export("stringByExpandingTildeInPath")]
NSString ExpandTildeInPath();
[Export("stringByStandardizingPath")]
NSString StandarizePath();
[Export("stringByResolvingSymlinksInPath")]
NSString ResolveSymlinksInPath();
[Export("stringsByAppendingPaths:")]
string[] AppendPaths( string[] paths );
// end methods from NSStringPathExtensions category
[Export ("capitalizedStringWithLocale:")]
string Capitalize ([NullAllowed] NSLocale locale);
[Export ("lowercaseStringWithLocale:")]
string ToLower (NSLocale locale);
[Export ("uppercaseStringWithLocale:")]
string ToUpper (NSLocale locale);
[iOS (8,0)]
[Export ("containsString:")]
bool Contains (NSString str);
[iOS (8,0), Mac (10,10)]
[Export ("localizedCaseInsensitiveContainsString:")]
bool LocalizedCaseInsensitiveContains (NSString str);
[iOS (8,0), Mac (10,10)]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Static, Export ("stringEncodingForData:encodingOptions:convertedString:usedLossyConversion:")]
nuint DetectStringEncoding (NSData rawData, NSDictionary options, out string convertedString, out bool usedLossyConversion);
[iOS (8,0), Mac(10,10)]
[Static, Wrap ("DetectStringEncoding(rawData,options.GetDictionary ()!, out convertedString, out usedLossyConversion)")]
nuint DetectStringEncoding (NSData rawData, EncodingDetectionOptions options, out string convertedString, out bool usedLossyConversion);
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionSuggestedEncodingsKey")]
NSString EncodingDetectionSuggestedEncodingsKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionDisallowedEncodingsKey")]
NSString EncodingDetectionDisallowedEncodingsKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionUseOnlySuggestedEncodingsKey")]
NSString EncodingDetectionUseOnlySuggestedEncodingsKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionAllowLossyKey")]
NSString EncodingDetectionAllowLossyKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionFromWindowsKey")]
NSString EncodingDetectionFromWindowsKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionLossySubstitutionKey")]
NSString EncodingDetectionLossySubstitutionKey { get; }
[iOS (8,0),Mac(10,10)]
[Internal, Field ("NSStringEncodingDetectionLikelyLanguageKey")]
NSString EncodingDetectionLikelyLanguageKey { get; }
[Export ("lineRangeForRange:")]
NSRange LineRangeForRange (NSRange range);
[Export ("getLineStart:end:contentsEnd:forRange:")]
void GetLineStart (out nuint startPtr, out nuint lineEndPtr, out nuint contentsEndPtr, NSRange range);
[iOS (9,0), Mac(10,11)]
[Export ("variantFittingPresentationWidth:")]
NSString GetVariantFittingPresentationWidth (nint width);
[iOS (9,0), Mac(10,11)]
[Export ("localizedStandardContainsString:")]
bool LocalizedStandardContainsString (NSString str);
[iOS (9,0), Mac(10,11)]
[Export ("localizedStandardRangeOfString:")]
NSRange LocalizedStandardRangeOfString (NSString str);
[iOS (9,0), Mac(10,11)]
[Export ("localizedUppercaseString")]
NSString LocalizedUppercaseString { get; }
[iOS (9,0), Mac(10,11)]
[Export ("localizedLowercaseString")]
NSString LocalizedLowercaseString { get; }
[iOS (9,0), Mac(10,11)]
[Export ("localizedCapitalizedString")]
NSString LocalizedCapitalizedString { get; }
[iOS (9,0), Mac(10,11)]
[Export ("stringByApplyingTransform:reverse:")]
[return: NullAllowed]
NSString TransliterateString (NSString transform, bool reverse);
[Export ("hasPrefix:")]
bool HasPrefix (NSString prefix);
[Export ("hasSuffix:")]
bool HasSuffix (NSString suffix);
// UNUserNotificationCenterSupport category
[iOS (10,0), Watch (3,0), NoTV, Mac (10,14)]
[Static]
[Export ("localizedUserNotificationStringForKey:arguments:")]
NSString GetLocalizedUserNotificationString (NSString key, [Params] [NullAllowed] NSObject [] arguments);
[Export ("getParagraphStart:end:contentsEnd:forRange:")]
void GetParagraphPositions (out nuint paragraphStartPosition, out nuint paragraphEndPosition, out nuint contentsEndPosition, NSRange range);
[Export ("paragraphRangeForRange:")]
NSRange GetParagraphRange (NSRange range);
[Export ("componentsSeparatedByString:")]
NSString[] SeparateComponents (NSString separator);
[Export ("componentsSeparatedByCharactersInSet:")]
NSString[] SeparateComponents (NSCharacterSet separator);
// From the NSItemProviderReading protocol
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
new string[] ReadableTypeIdentifiers { get; }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("objectWithItemProviderData:typeIdentifier:error:")]
[return: NullAllowed]
new NSString GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError);
// From the NSItemProviderWriting protocol
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Static]
[Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
new string[] WritableTypeIdentifiers { get; }
}
[StrongDictionary ("NSString")]
interface EncodingDetectionOptions {
NSStringEncoding [] EncodingDetectionSuggestedEncodings { get; set; }
NSStringEncoding [] EncodingDetectionDisallowedEncodings { get; set; }
bool EncodingDetectionUseOnlySuggestedEncodings { get; set; }
bool EncodingDetectionAllowLossy { get; set; }
bool EncodingDetectionFromWindows { get; set; }
NSString EncodingDetectionLossySubstitution { get; set; }
NSString EncodingDetectionLikelyLanguage { get; set; }
}
[BaseType (typeof (NSString))]
// hack: it seems that generator.cs can't track NSCoding correctly ? maybe because the type is named NSString2 at that time
interface NSMutableString : NSCoding {
[Export ("initWithCapacity:")]
NativeHandle Constructor (nint capacity);
[PreSnippet ("Check (index);", Optimizable = true)]
[Export ("insertString:atIndex:")]
void Insert (NSString str, nint index);
[PreSnippet ("Check (range);", Optimizable = true)]
[Export ("deleteCharactersInRange:")]
void DeleteCharacters (NSRange range);
[Export ("appendString:")]
void Append (NSString str);
[Export ("setString:")]
void SetString (NSString str);
[PreSnippet ("Check (range);", Optimizable = true)]
[Export ("replaceOccurrencesOfString:withString:options:range:")]
nuint ReplaceOcurrences (NSString target, NSString replacement, NSStringCompareOptions options, NSRange range);
[iOS (9,0), Mac(10,11)]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("applyTransform:reverse:range:updatedRange:")]
bool ApplyTransform (NSString transform, bool reverse, NSRange range, out NSRange resultingRange);
[iOS (9,0)][Mac (10,11)]
[Wrap ("ApplyTransform (transform.GetConstant ()!, reverse, range, out resultingRange)")]
bool ApplyTransform (NSStringTransform transform, bool reverse, NSRange range, out NSRange resultingRange);
[Export ("replaceCharactersInRange:withString:")]
void ReplaceCharactersInRange (NSRange range, NSString aString);
}
[Category, BaseType (typeof (NSString))]
partial interface NSUrlUtilities_NSString {
[iOS (7,0)]
[Export ("stringByAddingPercentEncodingWithAllowedCharacters:")]
NSString CreateStringByAddingPercentEncoding (NSCharacterSet allowedCharacters);
[iOS (7,0)]
[Export ("stringByRemovingPercentEncoding")]
NSString CreateStringByRemovingPercentEncoding ();
[Export ("stringByAddingPercentEscapesUsingEncoding:")]
NSString CreateStringByAddingPercentEscapes (NSStringEncoding enc);
[Export ("stringByReplacingPercentEscapesUsingEncoding:")]
NSString CreateStringByReplacingPercentEscapes (NSStringEncoding enc);
}
// This comes from UIKit.framework/Headers/NSStringDrawing.h
[NoMac]
[BaseType (typeof (NSObject))]
interface NSStringDrawingContext {
[Export ("minimumScaleFactor")]
nfloat MinimumScaleFactor { get; set; }
[NoTV]
[Deprecated (PlatformName.iOS, 7, 0)]
[NoMacCatalyst]
[Export ("minimumTrackingAdjustment")]
nfloat MinimumTrackingAdjustment { get; set; }
[Export ("actualScaleFactor")]
nfloat ActualScaleFactor { get; }
[NoTV]
[Deprecated (PlatformName.iOS, 7, 0)]
[Export ("actualTrackingAdjustment")]
nfloat ActualTrackingAdjustment { get; }
[Export ("totalBounds")]
CGRect TotalBounds { get; }
}
[BaseType (typeof (NSStream))]
[DefaultCtorVisibility (Visibility.Protected)]
interface NSInputStream {
[Export ("hasBytesAvailable")]
bool HasBytesAvailable ();
[Export ("initWithFileAtPath:")]
NativeHandle Constructor (string path);
[DesignatedInitializer]
[Export ("initWithData:")]
NativeHandle Constructor (NSData data);
[DesignatedInitializer]
[Export ("initWithURL:")]
NativeHandle Constructor (NSUrl url);
[Static]
[Export ("inputStreamWithData:")]
NSInputStream FromData (NSData data);
[Static]
[Export ("inputStreamWithFileAtPath:")]
NSInputStream FromFile (string path);
[Static]
[Export ("inputStreamWithURL:")]
NSInputStream FromUrl (NSUrl url);
#if NET
[return: NullAllowed]
[Protected]
[Export ("propertyForKey:"), Override]
NSObject GetProperty (NSString key);
[Protected]
[Export ("setProperty:forKey:"), Override]
bool SetProperty ([NullAllowed] NSObject property, NSString key);
#endif
}
delegate bool NSEnumerateLinguisticTagsEnumerator (NSString tag, NSRange tokenRange, NSRange sentenceRange, ref bool stop);
[Category]
[BaseType (typeof(NSString))]
interface NSLinguisticAnalysis {
#if NET
[return: BindAs (typeof (NSLinguisticTag []))]
#else
[return: BindAs (typeof (NSLinguisticTagUnit []))]
#endif
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("linguisticTagsInRange:scheme:options:orthography:tokenRanges:")]
NSString[] GetLinguisticTags (NSRange range, NSString scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, [NullAllowed] out NSValue[] tokenRanges);
[Wrap ("GetLinguisticTags (This, range, scheme.GetConstant ()!, options, orthography, out tokenRanges)")]
#if NET
NSLinguisticTag[] GetLinguisticTags (NSRange range, NSLinguisticTagScheme scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, [NullAllowed] out NSValue[] tokenRanges);
#else
NSLinguisticTagUnit[] GetLinguisticTags (NSRange range, NSLinguisticTagScheme scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, [NullAllowed] out NSValue[] tokenRanges);
#endif
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:")]
void EnumerateLinguisticTags (NSRange range, NSString scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, NSEnumerateLinguisticTagsEnumerator handler);
[Wrap ("EnumerateLinguisticTags (This, range, scheme.GetConstant ()!, options, orthography, handler)")]
void EnumerateLinguisticTags (NSRange range, NSLinguisticTagScheme scheme, NSLinguisticTaggerOptions options, [NullAllowed] NSOrthography orthography, NSEnumerateLinguisticTagsEnumerator handler);
}
//
// We expose NSString versions of these methods because it could
// avoid an extra lookup in cases where there is a large volume of
// calls being made and the keys are mostly tokens
//
[BaseType (typeof (NSObject)), Bind ("NSObject")]
interface NSObject2 : NSObjectProtocol {
// those are to please the compiler while creating the definition .dll
// but, for the final binary, we'll be using manually bounds alternatives
// not the generated code
#pragma warning disable 108
[Manual]
[Export ("conformsToProtocol:")]
bool ConformsToProtocol (NativeHandle /* Protocol */ aProtocol);
[Manual]
[Export ("retain")]
NSObject DangerousRetain ();
[Manual]
[Export ("release")]
void DangerousRelease ();
[Manual]
[Export ("autorelease")]
NSObject DangerousAutorelease ();
#pragma warning restore 108
[Export ("doesNotRecognizeSelector:")]
void DoesNotRecognizeSelector (Selector sel);
[Export ("observeValueForKeyPath:ofObject:change:context:")]
void ObserveValue (NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context);
[Export ("addObserver:forKeyPath:options:context:")]
void AddObserver (NSObject observer, NSString keyPath, NSKeyValueObservingOptions options, IntPtr context);
[Wrap ("AddObserver (observer, (NSString) keyPath, options, context)")]
void AddObserver (NSObject observer, string keyPath, NSKeyValueObservingOptions options, IntPtr context);
[Export ("removeObserver:forKeyPath:context:")]
void RemoveObserver (NSObject observer, NSString keyPath, IntPtr context);
[Wrap ("RemoveObserver (observer, (NSString) keyPath, context)")]
void RemoveObserver (NSObject observer, string keyPath, IntPtr context);
[Export ("removeObserver:forKeyPath:")]
void RemoveObserver (NSObject observer, NSString keyPath);
[Wrap ("RemoveObserver (observer, (NSString) keyPath)")]
void RemoveObserver (NSObject observer, string keyPath);
[Export ("willChangeValueForKey:")]
void WillChangeValue (string forKey);
[Export ("didChangeValueForKey:")]
void DidChangeValue (string forKey);
[Export ("willChange:valuesAtIndexes:forKey:")]
void WillChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString forKey);
[Export ("didChange:valuesAtIndexes:forKey:")]
void DidChange (NSKeyValueChange changeKind, NSIndexSet indexes, NSString forKey);
[Export ("willChangeValueForKey:withSetMutation:usingObjects:")]
void WillChange (NSString forKey, NSKeyValueSetMutationKind mutationKind, NSSet objects);
[Export ("didChangeValueForKey:withSetMutation:usingObjects:")]
void DidChange (NSString forKey, NSKeyValueSetMutationKind mutationKind, NSSet objects);
[Static, Export ("keyPathsForValuesAffectingValueForKey:")]
NSSet GetKeyPathsForValuesAffecting (NSString key);
[Static, Export ("automaticallyNotifiesObserversForKey:")]
bool AutomaticallyNotifiesObserversForKey (string key);
[Export ("valueForKey:")]
[MarshalNativeExceptions]
NSObject ValueForKey (NSString key);
[Export ("setValue:forKey:")]
void SetValueForKey (NSObject value, NSString key);
[Export ("valueForKeyPath:")]
NSObject ValueForKeyPath (NSString keyPath);
[Export ("setValue:forKeyPath:")]
void SetValueForKeyPath (NSObject value, NSString keyPath);
[Export ("valueForUndefinedKey:")]
NSObject ValueForUndefinedKey (NSString key);
[Export ("setValue:forUndefinedKey:")]
void SetValueForUndefinedKey (NSObject value, NSString undefinedKey);
[Export ("setNilValueForKey:")]
void SetNilValueForKey (NSString key);
[Export ("dictionaryWithValuesForKeys:")]
NSDictionary GetDictionaryOfValuesFromKeys (NSString [] keys);
[Export ("setValuesForKeysWithDictionary:")]
void SetValuesForKeysWithDictionary (NSDictionary keyedValues);
[Field ("NSKeyValueChangeKindKey")]
NSString ChangeKindKey { get; }
[Field ("NSKeyValueChangeNewKey")]
NSString ChangeNewKey { get; }
[Field ("NSKeyValueChangeOldKey")]
NSString ChangeOldKey { get; }
[Field ("NSKeyValueChangeIndexesKey")]
NSString ChangeIndexesKey { get; }
[Field ("NSKeyValueChangeNotificationIsPriorKey")]
NSString ChangeNotificationIsPriorKey { get; }
// Cocoa Bindings added by Kenneth J. Pouncey 2010/11/17
#if !NET
[Sealed]
#endif
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("valueClassForBinding:")]
Class GetBindingValueClass (NSString binding);
#if !NET
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'Bind (NSString binding, NSObject observable, string keyPath, [NullAllowed] NSDictionary options)' instead.")]
[Export ("bind:toObject:withKeyPath:options:")]
void Bind (string binding, NSObject observable, string keyPath, [NullAllowed] NSDictionary options);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'Unbind (NSString binding)' instead.")]
[Export ("unbind:")]
void Unbind (string binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'GetBindingValueClass (NSString binding)' instead.")]
[Export ("valueClassForBinding:")]
Class BindingValueClass (string binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'GetBindingInfo (NSString binding)' instead.")]
[Export ("infoForBinding:")]
NSDictionary BindingInfo (string binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'GetBindingOptionDescriptions (NSString aBinding)' instead.")]
[Export ("optionDescriptionsForBinding:")]
NSObject[] BindingOptionDescriptions (string aBinding);
[Static]
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Wrap ("GetDefaultPlaceholder (marker, (NSString) binding)")]
NSObject GetDefaultPlaceholder (NSObject marker, string binding);
[Static]
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Obsolete ("Use 'SetDefaultPlaceholder (NSObject placeholder, NSObject marker, NSString binding)' instead.")]
[Wrap ("SetDefaultPlaceholder (placeholder, marker, (NSString) binding)")]
void SetDefaultPlaceholder (NSObject placeholder, NSObject marker, string binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("exposedBindings")]
NSString[] ExposedBindings ();
#else
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("exposedBindings")]
NSString[] ExposedBindings { get; }
#endif
#if !NET
[Sealed]
#endif
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("bind:toObject:withKeyPath:options:")]
void Bind (NSString binding, NSObject observable, string keyPath, [NullAllowed] NSDictionary options);
#if !NET
[Sealed]
#endif
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("unbind:")]
void Unbind (NSString binding);
#if !NET
[Sealed]
#endif
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("infoForBinding:")]
NSDictionary GetBindingInfo (NSString binding);
#if !NET
[Sealed]
#endif
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("optionDescriptionsForBinding:")]
NSObject[] GetBindingOptionDescriptions (NSString aBinding);
// NSPlaceholders (informal) protocol
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, 10,15)]
[Static]
[Export ("defaultPlaceholderForMarker:withBinding:")]
NSObject GetDefaultPlaceholder (NSObject marker, NSString binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, 10,15)]
[Static]
[Export ("setDefaultPlaceholder:forMarker:withBinding:")]
void SetDefaultPlaceholder (NSObject placeholder, NSObject marker, NSString binding);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, message: "Now on 'NSEditor' protocol.")]
[Export ("objectDidEndEditing:")]
void ObjectDidEndEditing (NSObject editor);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, message: "Now on 'NSEditor' protocol.")]
[Export ("commitEditing")]
bool CommitEditing ();
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Deprecated (PlatformName.MacOSX, message: "Now on 'NSEditor' protocol.")]
[Export ("commitEditingWithDelegate:didCommitSelector:contextInfo:")]
void CommitEditing (NSObject objDelegate, Selector didCommitSelector, IntPtr contextInfo);
[Export ("methodForSelector:")]
IntPtr GetMethodForSelector (Selector sel);
[PreSnippet ("if (!(this is INSCopying)) throw new InvalidOperationException (\"Type does not conform to NSCopying\");", Optimizable = true)]
[Export ("copy")]
[return: Release ()]
NSObject Copy ();
[PreSnippet ("if (!(this is INSMutableCopying)) throw new InvalidOperationException (\"Type does not conform to NSMutableCopying\");", Optimizable = true)]
[Export ("mutableCopy")]
[return: Release ()]
NSObject MutableCopy ();
//
// Extra Perform methods, with selectors
//
[Export ("performSelector:withObject:afterDelay:inModes:")]
void PerformSelector (Selector selector, [NullAllowed] NSObject withObject, double afterDelay, NSString [] nsRunLoopModes);
[Export ("performSelector:withObject:afterDelay:")]
void PerformSelector (Selector selector, [NullAllowed] NSObject withObject, double delay);
[Export ("performSelector:onThread:withObject:waitUntilDone:")]
void PerformSelector (Selector selector, NSThread onThread, [NullAllowed] NSObject withObject, bool waitUntilDone);
[Export ("performSelector:onThread:withObject:waitUntilDone:modes:")]
void PerformSelector (Selector selector, NSThread onThread, [NullAllowed] NSObject withObject, bool waitUntilDone, [NullAllowed] NSString [] nsRunLoopModes);
[Static, Export ("cancelPreviousPerformRequestsWithTarget:")]
void CancelPreviousPerformRequest (NSObject aTarget);
[Static, Export ("cancelPreviousPerformRequestsWithTarget:selector:object:")]
void CancelPreviousPerformRequest (NSObject aTarget, Selector selector, [NullAllowed] NSObject argument);
[iOS (8,0), Mac (10,10)]
[NoWatch]
[Export ("prepareForInterfaceBuilder")]
void PrepareForInterfaceBuilder ();
[NoWatch]
#if MONOMAC
// comes from NSNibAwaking category and does not requires calling super
#else
[RequiresSuper] // comes from UINibLoadingAdditions category - which is decorated
#endif
[Export ("awakeFromNib")]
void AwakeFromNib ();
[NoWatch, TV (13,0), iOS (13,0), NoMac]
[Export ("accessibilityRespondsToUserInteraction")]
bool AccessibilityRespondsToUserInteraction { get; set; }
[NoWatch, TV (13,0), iOS (13,0), NoMac]
[Export ("accessibilityUserInputLabels", ArgumentSemantic.Strong)]
string [] AccessibilityUserInputLabels { get; set; }
[NoWatch, TV (13,0), iOS (13,0), NoMac]
[Export ("accessibilityAttributedUserInputLabels", ArgumentSemantic.Copy)]
NSAttributedString[] AccessibilityAttributedUserInputLabels { get; set; }
[NoWatch, TV (13,0), iOS (13,0), NoMac]
[NullAllowed, Export ("accessibilityTextualContext", ArgumentSemantic.Strong)]
string AccessibilityTextualContext { get; set; }
}
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
[Mac (10, 14)][NoWatch][NoTV][NoiOS]
interface NSBindingSelectionMarker : NSCopying {
[Static]
[Export ("multipleValuesSelectionMarker", ArgumentSemantic.Strong)]
NSBindingSelectionMarker MultipleValuesSelectionMarker { get; }
[Static]
[Export ("noSelectionMarker", ArgumentSemantic.Strong)]
NSBindingSelectionMarker NoSelectionMarker { get; }
[Static]
[Export ("notApplicableSelectionMarker", ArgumentSemantic.Strong)]
NSBindingSelectionMarker NotApplicableSelectionMarker { get; }
[Mac (10,15)]
[Static]
[Export ("setDefaultPlaceholder:forMarker:onClass:withBinding:")]
void SetDefaultPlaceholder ([NullAllowed] NSObject placeholder, [NullAllowed] NSBindingSelectionMarker marker, Class objectClass, string binding);
[Mac (10,15)]
[Static]
[Export ("defaultPlaceholderForMarker:onClass:withBinding:")]
[return: NullAllowed]
NSObject GetDefaultPlaceholder ([NullAllowed] NSBindingSelectionMarker marker, Class objectClass, string binding);
}
[Protocol (Name = "NSObject")] // exists both as a type and a protocol in ObjC, Swift uses NSObjectProtocol
interface NSObjectProtocol {
[Abstract]
[Export ("description")]
string Description { get; }
[Export ("debugDescription")]
string DebugDescription { get; }
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("superclass")]
Class Superclass { get; }
// defined multiple times (method, property and even static), one (not static) is required
// and that match Apple's documentation
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("hash")]
nuint GetNativeHash ();
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("isEqual:")]
bool IsEqual ([NullAllowed] NSObject anObject);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("class")]
Class Class { get; }
[Abstract]
[EditorBrowsable (EditorBrowsableState.Never)]
[Export ("self")][Transient]
NSObject Self { get; }
[Abstract]
[Export ("performSelector:")]
NSObject PerformSelector (Selector aSelector);
[Abstract]
[Export ("performSelector:withObject:")]
NSObject PerformSelector (Selector aSelector, [NullAllowed] NSObject anObject);
[Abstract]
[Export ("performSelector:withObject:withObject:")]
NSObject PerformSelector (Selector aSelector, [NullAllowed] NSObject object1, [NullAllowed] NSObject object2);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("isProxy")]
bool IsProxy { get; }
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("isKindOfClass:")]
bool IsKindOfClass ([NullAllowed] Class aClass);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("isMemberOfClass:")]
bool IsMemberOfClass ([NullAllowed] Class aClass);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("conformsToProtocol:")]
bool ConformsToProtocol ([NullAllowed] NativeHandle /* Protocol */ aProtocol);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("respondsToSelector:")]
bool RespondsToSelector ([NullAllowed] Selector sel);
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("retain")]
NSObject DangerousRetain ();
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("release")]
void DangerousRelease ();
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("autorelease")]
NSObject DangerousAutorelease ();
[Abstract]
[Export ("retainCount")]
nuint RetainCount { get; }
[Abstract]
[EditorBrowsable (EditorBrowsableState.Advanced)]
[Export ("zone")]
NSZone Zone { get; }
}
[BaseType (typeof (NSObject))]
interface NSOperation {
[Export ("start")]
void Start ();
[Export ("main")]
void Main ();
[Export ("isCancelled")]
bool IsCancelled { get; }
[Export ("cancel")]
void Cancel ();
[Export ("isExecuting")]
bool IsExecuting { get; }
[Export ("isFinished")]
bool IsFinished { get; }
[Export ("isConcurrent")]
bool IsConcurrent { get; }
[Export ("isReady")]
bool IsReady { get; }
[Export ("addDependency:")][PostGet ("Dependencies")]
void AddDependency (NSOperation op);
[Export ("removeDependency:")][PostGet ("Dependencies")]
void RemoveDependency (NSOperation op);
[Export ("dependencies")]
NSOperation [] Dependencies { get; }
[NullAllowed]
[Export ("completionBlock", ArgumentSemantic.Copy)]
Action CompletionBlock { get; set; }
[Export ("waitUntilFinished")]
void WaitUntilFinished ();
[Export ("threadPriority")]
[Deprecated (PlatformName.iOS, 8, 0)]
[Deprecated (PlatformName.WatchOS, 2, 0)]
[Deprecated (PlatformName.TvOS, 9, 0)]
[Deprecated (PlatformName.MacOSX, 10, 10)]
double ThreadPriority { get; set; }
//Detected properties
[Export ("queuePriority")]
NSOperationQueuePriority QueuePriority { get; set; }
[iOS (7,0)]
[Export ("asynchronous")]
bool Asynchronous { [Bind ("isAsynchronous")] get; }
[iOS (8,0)][Mac (10,10)]
[Export ("qualityOfService")]
NSQualityOfService QualityOfService { get; set; }
[iOS (8,0)][Mac (10,10)]
[NullAllowed] // by default this property is null
[Export ("name")]
string Name { get; set; }
}
[BaseType (typeof (NSOperation))]
interface NSBlockOperation {
[Static]
[Export ("blockOperationWithBlock:")]
NSBlockOperation Create (/* non null */ Action method);
[Export ("addExecutionBlock:")]
void AddExecutionBlock (/* non null */ Action method);
[Export ("executionBlocks")]
NSObject [] ExecutionBlocks { get; }
}
[BaseType (typeof (NSObject))]
interface NSOperationQueue : NSProgressReporting {
[Export ("addOperation:")][PostGet ("Operations")]
void AddOperation ([NullAllowed] NSOperation op);
[Export ("addOperations:waitUntilFinished:")][PostGet ("Operations")]
void AddOperations ([NullAllowed] NSOperation [] operations, bool waitUntilFinished);
[Export ("addOperationWithBlock:")][PostGet ("Operations")]
void AddOperation (/* non null */ Action operation);
[Deprecated (PlatformName.MacOSX, 10,15, 0, message: "This API should not be used as it is subject to race conditions. If synchronization is needed use 'AddBarrier' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "This API should not be used as it is subject to race conditions. If synchronization is needed use 'AddBarrier' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "This API should not be used as it is subject to race conditions. If synchronization is needed use 'AddBarrier' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "This API should not be used as it is subject to race conditions. If synchronization is needed use 'AddBarrier' instead.")]
[Export ("operations")]
NSOperation [] Operations { get; }
[Deprecated (PlatformName.MacOSX, 10,15)]
[Deprecated (PlatformName.iOS, 13,0)]
[Deprecated (PlatformName.WatchOS, 6,0)]
[Deprecated (PlatformName.TvOS, 13,0)]
[Export ("operationCount")]
nint OperationCount { get; }
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("addBarrierBlock:")]
void AddBarrier (Action barrier);
[Export ("name")]
string Name { get; set; }
[Export ("cancelAllOperations")][PostGet ("Operations")]
void CancelAllOperations ();
[Export ("waitUntilAllOperationsAreFinished")]
void WaitUntilAllOperationsAreFinished ();
[Static]
[Export ("currentQueue", ArgumentSemantic.Strong)]
NSOperationQueue CurrentQueue { get; }
[Static]
[Export ("mainQueue", ArgumentSemantic.Strong)]
NSOperationQueue MainQueue { get; }
//Detected properties
[Export ("maxConcurrentOperationCount")]
nint MaxConcurrentOperationCount { get; set; }
[Export ("suspended")]
bool Suspended { [Bind ("isSuspended")]get; set; }
[iOS (8,0)][Mac (10,10)]
[Export ("qualityOfService")]
NSQualityOfService QualityOfService { get; set; }
[NullAllowed]
[iOS (8,0)][Mac (10,10)]
[Export ("underlyingQueue", ArgumentSemantic.UnsafeUnretained)]
DispatchQueue UnderlyingQueue { get; set; }
}
interface NSOrderedSet<TKey> : NSOrderedSet {}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSOrderedSet : NSSecureCoding, NSMutableCopying {
[Export ("initWithObject:")]
NativeHandle Constructor (NSObject start);
[Export ("initWithArray:"), Internal]
NativeHandle Constructor (NSArray array);
[Export ("initWithSet:")]
NativeHandle Constructor (NSSet source);
[Export ("initWithOrderedSet:")]
NativeHandle Constructor (NSOrderedSet source);
[Export ("count")]
nint Count { get; }
[Internal]
[Sealed]
[Export ("objectAtIndex:")]
IntPtr _GetObject (nint idx);
[Export ("objectAtIndex:"), Internal]
NSObject GetObject (nint idx);
[Export ("array"), Internal]
IntPtr _ToArray ();
[Internal]
[Sealed]
[Export ("indexOfObject:")]
nint _IndexOf (IntPtr obj);
[Export ("indexOfObject:")]
nint IndexOf (NSObject obj);
[Export ("objectEnumerator"), Internal]
NSEnumerator _GetEnumerator ();
[Internal]
[Sealed]
[Export ("set")]
IntPtr _AsSet ();
[Export ("set")]
NSSet AsSet ();
[Internal]
[Sealed]
[Export ("containsObject:")]
bool _Contains (IntPtr obj);
[Export ("containsObject:")]
bool Contains (NSObject obj);
[Internal]
[Sealed]
[Export ("firstObject")]
IntPtr _FirstObject ();
[Export ("firstObject")]
NSObject FirstObject ();
[Internal]
[Sealed]
[Export ("lastObject")]
IntPtr _LastObject ();
[Export ("lastObject")]
NSObject LastObject ();
[Export ("isEqualToOrderedSet:")]
bool IsEqualToOrderedSet (NSOrderedSet other);
[Export ("intersectsOrderedSet:")]
bool Intersects (NSOrderedSet other);
[Export ("intersectsSet:")]
bool Intersects (NSSet other);
[Export ("isSubsetOfOrderedSet:")]
bool IsSubset (NSOrderedSet other);
[Export ("isSubsetOfSet:")]
bool IsSubset (NSSet other);
[Export ("reversedOrderedSet")]
NSOrderedSet GetReverseOrderedSet ();
}
interface NSMutableOrderedSet<TKey> : NSMutableOrderedSet {}
[BaseType (typeof (NSOrderedSet))]
[DesignatedDefaultCtor]
interface NSMutableOrderedSet {
[Export ("initWithObject:")]
NativeHandle Constructor (NSObject start);
[Export ("initWithSet:")]
NativeHandle Constructor (NSSet source);
[Export ("initWithOrderedSet:")]
NativeHandle Constructor (NSOrderedSet source);
[DesignatedInitializer]
[Export ("initWithCapacity:")]
NativeHandle Constructor (nint capacity);
[Export ("initWithArray:"), Internal]
NativeHandle Constructor (NSArray array);
[Export ("unionSet:"), Internal]
void UnionSet (NSSet other);
[Export ("minusSet:"), Internal]
void MinusSet (NSSet other);
[Export ("unionOrderedSet:"), Internal]
void UnionSet (NSOrderedSet other);
[Export ("minusOrderedSet:"), Internal]
void MinusSet (NSOrderedSet other);
[Internal]
[Sealed]
[Export ("insertObject:atIndex:")]
void _Insert (IntPtr obj, nint atIndex);
[Export ("insertObject:atIndex:")]
void Insert (NSObject obj, nint atIndex);
[Export ("removeObjectAtIndex:")]
void Remove (nint index);
[Internal]
[Sealed]
[Export ("replaceObjectAtIndex:withObject:")]
void _Replace (nint objectAtIndex, IntPtr newObject);
[Export ("replaceObjectAtIndex:withObject:")]
void Replace (nint objectAtIndex, NSObject newObject);
[Internal]
[Sealed]
[Export ("addObject:")]
void _Add (IntPtr obj);
[Export ("addObject:")]
void Add (NSObject obj);
[Internal]
[Sealed]
[Export ("addObjectsFromArray:")]
void _AddObjects (NSArray source);
[Export ("addObjectsFromArray:")]
void AddObjects (NSObject [] source);
[Internal]
[Sealed]
[Export ("insertObjects:atIndexes:")]
void _InsertObjects (NSArray objects, NSIndexSet atIndexes);
[Export ("insertObjects:atIndexes:")]
void InsertObjects (NSObject [] objects, NSIndexSet atIndexes);
[Export ("removeObjectsAtIndexes:")]
void RemoveObjects (NSIndexSet indexSet);
[Export ("exchangeObjectAtIndex:withObjectAtIndex:")]
void ExchangeObject (nint first, nint second);
[Export ("moveObjectsAtIndexes:toIndex:")]
void MoveObjects (NSIndexSet indexSet, nint destination);
[Internal]
[Sealed]
[Export ("setObject:atIndex:")]
void _SetObject (IntPtr obj, nint index);
[Export ("setObject:atIndex:")]
void SetObject (NSObject obj, nint index);
[Internal]
[Sealed]
[Export ("replaceObjectsAtIndexes:withObjects:")]
void _ReplaceObjects (NSIndexSet indexSet, NSArray replacementObjects);
[Export ("replaceObjectsAtIndexes:withObjects:")]
void ReplaceObjects (NSIndexSet indexSet, NSObject [] replacementObjects);
[Export ("removeObjectsInRange:")]
void RemoveObjects (NSRange range);
[Export ("removeAllObjects")]
void RemoveAllObjects ();
[Internal]
[Sealed]
[Export ("removeObject:")]
void _RemoveObject (IntPtr obj);
[Export ("removeObject:")]
void RemoveObject (NSObject obj);
[Internal]
[Sealed]
[Export ("removeObjectsInArray:")]
void _RemoveObjects (NSArray objects);
[Export ("removeObjectsInArray:")]
void RemoveObjects (NSObject [] objects);
[Export ("intersectOrderedSet:")]
void Intersect (NSOrderedSet intersectWith);
[Export ("intersectSet:")]
void Intersect (NSSet intersectWith);
[Export ("sortUsingComparator:")]
void Sort (NSComparator comparator);
[Export ("sortWithOptions:usingComparator:")]
void Sort (NSSortOptions sortOptions, NSComparator comparator);
[Export ("sortRange:options:usingComparator:")]
void SortRange (NSRange range, NSSortOptions sortOptions, NSComparator comparator);
}
[BaseType (typeof (NSObject))]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
[DisableDefaultCtor]
interface NSOrthography : NSSecureCoding, NSCopying {
[Export ("dominantScript")]
string DominantScript { get; }
[Export ("languageMap")]
NSDictionary LanguageMap { get; }
[Export ("dominantLanguage")]
string DominantLanguage { get; }
[Export ("allScripts")]
string [] AllScripts { get; }
[Export ("allLanguages")]
string [] AllLanguages { get; }
[Export ("languagesForScript:")]
string [] LanguagesForScript (string script);
[Export ("dominantLanguageForScript:")]
string DominantLanguageForScript (string script);
[DesignatedInitializer]
[Export ("initWithDominantScript:languageMap:")]
NativeHandle Constructor (string dominantScript, [NullAllowed] NSDictionary languageMap);
}
[BaseType (typeof (NSStream))]
[DisableDefaultCtor] // crash when used
interface NSOutputStream {
[DesignatedInitializer]
[Export ("initToMemory")]
NativeHandle Constructor ();
[Export ("hasSpaceAvailable")]
bool HasSpaceAvailable ();
//[Export ("initToBuffer:capacity:")]
//NativeHandle Constructor (uint8_t buffer, NSUInteger capacity);
[Export ("initToFileAtPath:append:")]
NativeHandle Constructor (string path, bool shouldAppend);
[Static]
[Export ("outputStreamToMemory")]
NSObject OutputStreamToMemory ();
//[Static]
//[Export ("outputStreamToBuffer:capacity:")]
//NSObject OutputStreamToBuffer (uint8_t buffer, NSUInteger capacity);
[Static]
[Export ("outputStreamToFileAtPath:append:")]
NSOutputStream CreateFile (string path, bool shouldAppend);
#if NET
[return: NullAllowed]
[Protected]
[Export ("propertyForKey:"), Override]
NSObject GetProperty (NSString key);
[Protected]
[Export ("setProperty:forKey:"), Override]
bool SetProperty ([NullAllowed] NSObject property, NSString key);
#endif
}
[BaseType (typeof (NSObject), Name="NSHTTPCookie")]
// default 'init' crash both simulator and devices
[DisableDefaultCtor]
interface NSHttpCookie {
[Export ("initWithProperties:")]
NativeHandle Constructor (NSDictionary properties);
[Export ("cookieWithProperties:"), Static]
NSHttpCookie CookieFromProperties (NSDictionary properties);
[Export ("requestHeaderFieldsWithCookies:"), Static]
NSDictionary RequestHeaderFieldsWithCookies (NSHttpCookie [] cookies);
[Export ("cookiesWithResponseHeaderFields:forURL:"), Static]
NSHttpCookie [] CookiesWithResponseHeaderFields (NSDictionary headerFields, NSUrl url);
[Export ("properties")]
NSDictionary Properties { get; }
[Export ("version")]
nuint Version { get; }
[Export ("value")]
string Value { get; }
[Export ("expiresDate")]
NSDate ExpiresDate { get; }
[Export ("isSessionOnly")]
bool IsSessionOnly { get; }
[Export ("domain")]
string Domain { get; }
[Export ("name")]
string Name { get; }
[Export ("path")]
string Path { get; }
[Export ("isSecure")]
bool IsSecure { get; }
[Export ("isHTTPOnly")]
bool IsHttpOnly { get; }
[Export ("comment")]
string Comment { get; }
[Export ("commentURL")]
NSUrl CommentUrl { get; }
[Export ("portList")]
NSNumber [] PortList { get; }
[Field ("NSHTTPCookieName")]
NSString KeyName { get; }
[Field ("NSHTTPCookieValue")]
NSString KeyValue { get; }
[Field ("NSHTTPCookieOriginURL")]
NSString KeyOriginUrl { get; }
[Field ("NSHTTPCookieVersion")]
NSString KeyVersion { get; }
[Field ("NSHTTPCookieDomain")]
NSString KeyDomain { get; }
[Field ("NSHTTPCookiePath")]
NSString KeyPath { get; }
[Field ("NSHTTPCookieSecure")]
NSString KeySecure { get; }
[Field ("NSHTTPCookieExpires")]
NSString KeyExpires { get; }
[Field ("NSHTTPCookieComment")]
NSString KeyComment { get; }
[Field ("NSHTTPCookieCommentURL")]
NSString KeyCommentUrl { get; }
[Field ("NSHTTPCookieDiscard")]
NSString KeyDiscard { get; }
[Field ("NSHTTPCookieMaximumAge")]
NSString KeyMaximumAge { get; }
[Field ("NSHTTPCookiePort")]
NSString KeyPort { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Field ("NSHTTPCookieSameSitePolicy")]
NSString KeySameSitePolicy { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Field ("NSHTTPCookieSameSiteLax")]
NSString KeySameSiteLax { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Field ("NSHTTPCookieSameSiteStrict")]
NSString KeySameSiteStrict { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("sameSitePolicy")]
NSString SameSitePolicy { get; }
}
[BaseType (typeof (NSObject), Name="NSHTTPCookieStorage")]
// NSHTTPCookieStorage implements a singleton object -> use SharedStorage since 'init' returns NIL
[DisableDefaultCtor]
interface NSHttpCookieStorage {
[Export ("sharedHTTPCookieStorage", ArgumentSemantic.Strong), Static]
NSHttpCookieStorage SharedStorage { get; }
[Export ("cookies")]
NSHttpCookie [] Cookies { get; }
[Export ("setCookie:")]
void SetCookie (NSHttpCookie cookie);
[Export ("deleteCookie:")]
void DeleteCookie (NSHttpCookie cookie);
[Export ("cookiesForURL:")]
NSHttpCookie [] CookiesForUrl (NSUrl url);
[Export ("setCookies:forURL:mainDocumentURL:")]
void SetCookies (NSHttpCookie [] cookies, NSUrl forUrl, NSUrl mainDocumentUrl);
[Export ("cookieAcceptPolicy")]
NSHttpCookieAcceptPolicy AcceptPolicy { get; set; }
[Export ("sortedCookiesUsingDescriptors:")]
NSHttpCookie [] GetSortedCookies (NSSortDescriptor [] sortDescriptors);
// @required - (void)removeCookiesSinceDate:(NSDate *)date;
[Mac (10,10)][iOS (8,0)]
[Export ("removeCookiesSinceDate:")]
void RemoveCookiesSinceDate (NSDate date);
[iOS (9,0), Mac (10,11)]
[Static]
[Export ("sharedCookieStorageForGroupContainerIdentifier:")]
NSHttpCookieStorage GetSharedCookieStorage (string groupContainerIdentifier);
[Mac (10,10)][iOS (8,0)]
[Async]
[Export ("getCookiesForTask:completionHandler:")]
void GetCookiesForTask (NSUrlSessionTask task, Action<NSHttpCookie []> completionHandler);
[Mac (10,10)][iOS (8,0)]
[Export ("storeCookies:forTask:")]
void StoreCookies (NSHttpCookie [] cookies, NSUrlSessionTask task);
[Notification]
[Field ("NSHTTPCookieManagerAcceptPolicyChangedNotification")]
NSString CookiesChangedNotification { get; }
[Notification]
[Field ("NSHTTPCookieManagerCookiesChangedNotification")]
NSString AcceptPolicyChangedNotification { get; }
}
[BaseType (typeof (NSUrlResponse), Name="NSHTTPURLResponse")]
interface NSHttpUrlResponse {
[Export ("initWithURL:MIMEType:expectedContentLength:textEncodingName:")]
NativeHandle Constructor (NSUrl url, string mimetype, nint expectedContentLength, [NullAllowed] string textEncodingName);
[Export ("initWithURL:statusCode:HTTPVersion:headerFields:")]
NativeHandle Constructor (NSUrl url, nint statusCode, [NullAllowed] string httpVersion, [NullAllowed] NSDictionary headerFields);
[Export ("statusCode")]
nint StatusCode { get; }
[Export ("allHeaderFields")]
NSDictionary AllHeaderFields { get; }
[Export ("localizedStringForStatusCode:")][Static]
string LocalizedStringForStatusCode (nint statusCode);
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Export ("valueForHTTPHeaderField:")]
[return: NullAllowed]
string GetHttpHeaderValue (string headerField);
}
[BaseType (typeof (NSObject))]
#if MONOMAC
[DisableDefaultCtor] // An uncaught exception was raised: -[__NSCFDictionary removeObjectForKey:]: attempt to remove nil key
#endif
partial interface NSBundle {
[Export ("mainBundle")][Static]
NSBundle MainBundle { get; }
[Export ("bundleWithPath:")][Static]
NSBundle FromPath (string path);
[DesignatedInitializer]
[Export ("initWithPath:")]
NativeHandle Constructor (string path);
[Export ("bundleForClass:")][Static]
NSBundle FromClass (Class c);
[Export ("bundleWithIdentifier:")][Static]
NSBundle FromIdentifier (string str);
[Export ("allBundles")][Static]
NSBundle [] _AllBundles { get; }
[Export ("allFrameworks")][Static]
NSBundle [] AllFrameworks { get; }
[Export ("load")]
bool Load ();
[Export ("isLoaded")]
bool IsLoaded { get; }
[Export ("unload")]
bool Unload ();
[Export ("bundlePath")]
string BundlePath { get; }
[Export ("resourcePath")]
string ResourcePath { get; }
[Export ("executablePath")]
string ExecutablePath { get; }
[Export ("pathForAuxiliaryExecutable:")]
string PathForAuxiliaryExecutable (string s);
[Export ("privateFrameworksPath")]
string PrivateFrameworksPath { get; }
[Export ("sharedFrameworksPath")]
string SharedFrameworksPath { get; }
[Export ("sharedSupportPath")]
string SharedSupportPath { get; }
[Export ("builtInPlugInsPath")]
string BuiltinPluginsPath { get; }
[Export ("bundleIdentifier")]
string BundleIdentifier { get; }
[Export ("classNamed:")]
Class ClassNamed (string className);
[Export ("principalClass")]
Class PrincipalClass { get; }
[Export ("pathForResource:ofType:inDirectory:")][Static]
string PathForResourceAbsolute (string name, [NullAllowed] string ofType, string bundleDirectory);
[Export ("pathForResource:ofType:")]
string PathForResource (string name, [NullAllowed] string ofType);
[Export ("pathForResource:ofType:inDirectory:")]
string PathForResource (string name, [NullAllowed] string ofType, [NullAllowed] string subpath);
[Export ("pathForResource:ofType:inDirectory:forLocalization:")]
string PathForResource (string name, [NullAllowed] string ofType, string subpath, string localizationName);
[Export ("localizedStringForKey:value:table:")]
NSString GetLocalizedString ([NullAllowed] NSString key, [NullAllowed] NSString value, [NullAllowed] NSString table);
[Export ("objectForInfoDictionaryKey:")]
NSObject ObjectForInfoDictionary (string key);
[Export ("developmentLocalization")]
string DevelopmentLocalization { get; }
[Export ("infoDictionary")]
NSDictionary InfoDictionary{ get; }
// Additions from AppKit
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("loadNibNamed:owner:topLevelObjects:")]
bool LoadNibNamed (string nibName, [NullAllowed] NSObject owner, out NSArray topLevelObjects);
// https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSBundle_AppKitAdditions/Reference/Reference.html
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Static]
[Deprecated (PlatformName.MacOSX, 10, 8)]
[Export ("loadNibNamed:owner:")]
bool LoadNib (string nibName, NSObject owner);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("pathForImageResource:")]
string PathForImageResource (string resource);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("pathForSoundResource:")]
string PathForSoundResource (string resource);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("URLForImageResource:")]
NSUrl GetUrlForImageResource (string resource);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("contextHelpForKey:")]
NSAttributedString GetContextHelp (string key);
// http://developer.apple.com/library/ios/#documentation/uikit/reference/NSBundle_UIKitAdditions/Introduction/Introduction.html
[NoMac]
[NoWatch]
[Export ("loadNibNamed:owner:options:")]
NSArray LoadNib (string nibName, [NullAllowed] NSObject owner, [NullAllowed] NSDictionary options);
[Export ("bundleURL")]
NSUrl BundleUrl { get; }
[Export ("resourceURL")]
NSUrl ResourceUrl { get; }
[Export ("executableURL")]
NSUrl ExecutableUrl { get; }
[Export ("URLForAuxiliaryExecutable:")]
NSUrl UrlForAuxiliaryExecutable (string executable);
[Export ("privateFrameworksURL")]
NSUrl PrivateFrameworksUrl { get; }
[Export ("sharedFrameworksURL")]
NSUrl SharedFrameworksUrl { get; }
[Export ("sharedSupportURL")]
NSUrl SharedSupportUrl { get; }
[Export ("builtInPlugInsURL")]
NSUrl BuiltInPluginsUrl { get; }
[Export ("initWithURL:")]
NativeHandle Constructor (NSUrl url);
[Static, Export ("bundleWithURL:")]
NSBundle FromUrl (NSUrl url);
[Export ("preferredLocalizations")]
string [] PreferredLocalizations { get; }
[Export ("localizations")]
string [] Localizations { get; }
[iOS (7,0)]
[Export ("appStoreReceiptURL")]
NSUrl AppStoreReceiptUrl { get; }
[Export ("pathsForResourcesOfType:inDirectory:")]
string [] PathsForResources (string fileExtension, [NullAllowed] string subDirectory);
[Export ("pathsForResourcesOfType:inDirectory:forLocalization:")]
string [] PathsForResources (string fileExtension, [NullAllowed] string subDirectory, [NullAllowed] string localizationName);
[Static, Export ("pathsForResourcesOfType:inDirectory:")]
string [] GetPathsForResources (string fileExtension, string bundlePath);
[Static, Export ("URLForResource:withExtension:subdirectory:inBundleWithURL:")]
NSUrl GetUrlForResource (string name, string fileExtension, [NullAllowed] string subdirectory, NSUrl bundleURL);
[Static, Export ("URLsForResourcesWithExtension:subdirectory:inBundleWithURL:")]
NSUrl [] GetUrlsForResourcesWithExtension (string fileExtension, [NullAllowed] string subdirectory, NSUrl bundleURL);
[Export ("URLForResource:withExtension:")]
NSUrl GetUrlForResource (string name, string fileExtension);
[Export ("URLForResource:withExtension:subdirectory:")]
NSUrl GetUrlForResource (string name, string fileExtension, [NullAllowed] string subdirectory);
[Export ("URLForResource:withExtension:subdirectory:localization:")]
NSUrl GetUrlForResource (string name, string fileExtension, [NullAllowed] string subdirectory, [NullAllowed] string localizationName);
[Export ("URLsForResourcesWithExtension:subdirectory:")]
NSUrl [] GetUrlsForResourcesWithExtension (string fileExtension, [NullAllowed] string subdirectory);
[Export ("URLsForResourcesWithExtension:subdirectory:localization:")]
NSUrl [] GetUrlsForResourcesWithExtension (string fileExtension, [NullAllowed] string subdirectory, [NullAllowed] string localizationName);
[NoMac]
[iOS (9,0)]
[Export ("preservationPriorityForTag:")]
double GetPreservationPriority (NSString tag);
[NoMac]
[iOS (9,0)]
[Export ("setPreservationPriority:forTags:")]
void SetPreservationPriority (double priority, NSSet<NSString> tags);
}
[NoMac]
[iOS (9,0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface NSBundleResourceRequest : NSProgressReporting
{
[Export ("initWithTags:")]
NativeHandle Constructor (NSSet<NSString> tags);
[Export ("initWithTags:bundle:")]
[DesignatedInitializer]
NativeHandle Constructor (NSSet<NSString> tags, NSBundle bundle);
[Export ("loadingPriority")]
double LoadingPriority { get; set; }
[Export ("tags", ArgumentSemantic.Copy)]
NSSet<NSString> Tags { get; }
[Export ("bundle", ArgumentSemantic.Strong)]
NSBundle Bundle { get; }
[Export ("beginAccessingResourcesWithCompletionHandler:")]
[Async]
void BeginAccessingResources (Action<NSError> completionHandler);
[Export ("conditionallyBeginAccessingResourcesWithCompletionHandler:")]
[Async]
void ConditionallyBeginAccessingResources (Action<bool> completionHandler);
[Export ("endAccessingResources")]
void EndAccessingResources ();
[Field ("NSBundleResourceRequestLowDiskSpaceNotification")]
[Notification]
NSString LowDiskSpaceNotification { get; }
[Field ("NSBundleResourceRequestLoadingPriorityUrgent")]
double LoadingPriorityUrgent { get; }
}
[BaseType (typeof (NSObject))]
interface NSIndexPath : NSCoding, NSSecureCoding, NSCopying {
[Export ("indexPathWithIndex:")][Static]
NSIndexPath FromIndex (nuint index);
[Export ("indexPathWithIndexes:length:")][Internal][Static]
NSIndexPath _FromIndex (IntPtr indexes, nint len);
[Export ("indexPathByAddingIndex:")]
NSIndexPath IndexPathByAddingIndex (nuint index);
[Export ("indexPathByRemovingLastIndex")]
NSIndexPath IndexPathByRemovingLastIndex ();
[Export ("indexAtPosition:")]
nuint IndexAtPosition (nint position);
[Export ("length")]
nint Length { get; }
[Export ("getIndexes:")][Internal]
void _GetIndexes (IntPtr target);
[Mac (10,9)][iOS (7,0)]
[Export ("getIndexes:range:")][Internal]
void _GetIndexes (IntPtr target, NSRange positionRange);
[Export ("compare:")]
nint Compare (NSIndexPath other);
// NSIndexPath UIKit Additions Reference
// https://developer.apple.com/library/ios/#documentation/UIKit/Reference/NSIndexPath_UIKitAdditions/Reference/Reference.html
// see monotouch/src/UIKit/Addition.cs for int-returning Row/Section properties
[NoMac]
[NoWatch]
[Export ("row")]
nint LongRow { get; }
[NoMac]
[NoWatch]
[Export ("section")]
nint LongSection { get; }
[NoMac]
[NoWatch]
[Static]
[Export ("indexPathForRow:inSection:")]
NSIndexPath FromRowSection (nint row, nint section);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Mac (10,11)]
[Export ("section")]
nint Section { get; }
[NoWatch]
[Static]
[Mac (10,11)]
[Export ("indexPathForItem:inSection:")]
NSIndexPath FromItemSection (nint item, nint section);
[NoWatch]
[Export ("item")]
[Mac (10,11)]
nint Item { get; }
}
delegate void NSRangeIterator (NSRange range, ref bool stop);
[BaseType (typeof (NSObject))]
interface NSIndexSet : NSCoding, NSSecureCoding, NSMutableCopying {
[Static, Export ("indexSetWithIndex:")]
NSIndexSet FromIndex (nint idx);
[Static, Export ("indexSetWithIndexesInRange:")]
NSIndexSet FromNSRange (NSRange indexRange);
[Export ("initWithIndex:")]
NativeHandle Constructor (nuint index);
[DesignatedInitializer]
[Export ("initWithIndexSet:")]
NativeHandle Constructor (NSIndexSet other);
[Export ("count")]
nint Count { get; }
[Export ("isEqualToIndexSet:")]
bool IsEqual (NSIndexSet other);
[Export ("firstIndex")]
nuint FirstIndex { get; }
[Export ("lastIndex")]
nuint LastIndex { get; }
[Export ("indexGreaterThanIndex:")]
nuint IndexGreaterThan (nuint index);
[Export ("indexLessThanIndex:")]
nuint IndexLessThan (nuint index);
[Export ("indexGreaterThanOrEqualToIndex:")]
nuint IndexGreaterThanOrEqual (nuint index);
[Export ("indexLessThanOrEqualToIndex:")]
nuint IndexLessThanOrEqual (nuint index);
[Export ("containsIndex:")]
bool Contains (nuint index);
[Export ("containsIndexes:")]
bool Contains (NSIndexSet indexes);
[Export ("enumerateRangesUsingBlock:")]
void EnumerateRanges (NSRangeIterator iterator);
[Export ("enumerateRangesWithOptions:usingBlock:")]
void EnumerateRanges (NSEnumerationOptions opts, NSRangeIterator iterator);
[Export ("enumerateRangesInRange:options:usingBlock:")]
void EnumerateRanges (NSRange range, NSEnumerationOptions opts, NSRangeIterator iterator);
[Export ("enumerateIndexesUsingBlock:")]
void EnumerateIndexes (EnumerateIndexSetCallback enumeratorCallback);
[Export ("enumerateIndexesWithOptions:usingBlock:")]
void EnumerateIndexes (NSEnumerationOptions opts, EnumerateIndexSetCallback enumeratorCallback);
[Export ("enumerateIndexesInRange:options:usingBlock:")]
void EnumerateIndexes (NSRange range, NSEnumerationOptions opts, EnumerateIndexSetCallback enumeratorCallback);
}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // from the docs: " you should not create these objects using alloc and init."
interface NSInvocation {
[Export ("selector")]
Selector Selector { get; set; }
[Export ("target", ArgumentSemantic.Assign), NullAllowed]
NSObject Target { get; set; }
// FIXME: We need some special marshaling support to handle these buffers...
[Internal, Export ("setArgument:atIndex:")]
void _SetArgument (IntPtr buffer, nint index);
[Internal, Export ("getArgument:atIndex:")]
void _GetArgument (IntPtr buffer, nint index);
[Internal, Export ("setReturnValue:")]
void _SetReturnValue (IntPtr buffer);
[Internal, Export ("getReturnValue:")]
void _GetReturnValue (IntPtr buffer);
[Export ("invoke")]
void Invoke ();
[Export ("invokeWithTarget:")]
void Invoke (NSObject target);
[Export ("methodSignature")]
NSMethodSignature MethodSignature { get; }
}
[iOS (8,0)][Mac (10,10)] // Not defined in 32-bit
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
partial interface NSItemProvider : NSCopying {
[DesignatedInitializer]
[Export ("initWithItem:typeIdentifier:")]
NativeHandle Constructor ([NullAllowed] NSObject item, string typeIdentifier);
[Export ("initWithContentsOfURL:")]
NativeHandle Constructor (NSUrl fileUrl);
[Export ("registeredTypeIdentifiers", ArgumentSemantic.Copy)]
string [] RegisteredTypeIdentifiers { get; }
[Export ("registerItemForTypeIdentifier:loadHandler:")]
void RegisterItemForTypeIdentifier (string typeIdentifier, NSItemProviderLoadHandler loadHandler);
[Export ("hasItemConformingToTypeIdentifier:")]
bool HasItemConformingTo (string typeIdentifier);
[Async]
[Export ("loadItemForTypeIdentifier:options:completionHandler:")]
void LoadItem (string typeIdentifier, [NullAllowed] NSDictionary options, [NullAllowed] Action<NSObject,NSError> completionHandler);
[Field ("NSItemProviderPreferredImageSizeKey")]
NSString PreferredImageSizeKey { get; }
[Export ("setPreviewImageHandler:")]
void SetPreviewImageHandler (NSItemProviderLoadHandler handler);
[Async]
[Export ("loadPreviewImageWithOptions:completionHandler:")]
void LoadPreviewImage (NSDictionary options, Action<NSObject,NSError> completionHandler);
[Field ("NSItemProviderErrorDomain")]
NSString ErrorDomain { get; }
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Export ("sourceFrame")]
CGRect SourceFrame { get; }
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Export ("containerFrame")]
CGRect ContainerFrame { get; }
[NoWatch, NoTV]
[iOS (11,0)]
[MacCatalyst (13, 0)]
[Export ("preferredPresentationSize")]
CGSize PreferredPresentationSize {
get;
#if !MONOMAC
[NoMac]
set;
#endif
}
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (10,12)] // [Async] handled by NSItemProvider.cs for backwards compat reasons
[Export ("registerCloudKitShareWithPreparationHandler:")]
void RegisterCloudKitShare (CloudKitRegistrationPreparationAction preparationHandler);
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (10,12)]
[Export ("registerCloudKitShare:container:")]
void RegisterCloudKitShare (CKShare share, CKContainer container);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("registerDataRepresentationForTypeIdentifier:visibility:loadHandler:")]
void RegisterDataRepresentation (string typeIdentifier, NSItemProviderRepresentationVisibility visibility, RegisterDataRepresentationLoadHandler loadHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:")]
void RegisterFileRepresentation (string typeIdentifier, NSItemProviderFileOptions fileOptions, NSItemProviderRepresentationVisibility visibility, RegisterFileRepresentationLoadHandler loadHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("registeredTypeIdentifiersWithFileOptions:")]
string[] GetRegisteredTypeIdentifiers (NSItemProviderFileOptions fileOptions);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("hasRepresentationConformingToTypeIdentifier:fileOptions:")]
bool HasConformingRepresentation (string typeIdentifier, NSItemProviderFileOptions fileOptions);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async, Export ("loadDataRepresentationForTypeIdentifier:completionHandler:")]
NSProgress LoadDataRepresentation (string typeIdentifier, Action <NSData, NSError> completionHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async, Export ("loadFileRepresentationForTypeIdentifier:completionHandler:")]
NSProgress LoadFileRepresentation (string typeIdentifier, Action <NSUrl, NSError> completionHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async (ResultTypeName = "LoadInPlaceResult"), Export ("loadInPlaceFileRepresentationForTypeIdentifier:completionHandler:")]
NSProgress LoadInPlaceFileRepresentation (string typeIdentifier, LoadInPlaceFileRepresentationHandler completionHandler);
[NoWatch, NoTV, iOS (11,0)]
[Mac (10,14)]
[NullAllowed, Export ("suggestedName")]
string SuggestedName { get; set; }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("initWithObject:")]
NativeHandle Constructor (INSItemProviderWriting @object);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("registerObject:visibility:")]
void RegisterObject (INSItemProviderWriting @object, NSItemProviderRepresentationVisibility visibility);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("registerObjectOfClass:visibility:loadHandler:")]
void RegisterObject (Class aClass, NSItemProviderRepresentationVisibility visibility, RegisterObjectRepresentationLoadHandler loadHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Wrap ("RegisterObject (new Class (type), visibility, loadHandler)")]
void RegisterObject (Type type, NSItemProviderRepresentationVisibility visibility, RegisterObjectRepresentationLoadHandler loadHandler);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("canLoadObjectOfClass:")]
bool CanLoadObject (Class aClass);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Wrap ("CanLoadObject (new Class (type))")]
bool CanLoadObject (Type type);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async, Export ("loadObjectOfClass:completionHandler:")]
NSProgress LoadObject (Class aClass, Action<INSItemProviderReading, NSError> completionHandler);
// NSItemProvider_UIKitAdditions category
[NoWatch, NoTV]
[NoMac]
[iOS (11,0)]
[MacCatalyst (13, 0)]
[NullAllowed, Export ("teamData", ArgumentSemantic.Copy)]
NSData TeamData { get; set; }
[NoWatch, NoTV]
[NoMac]
[iOS (11,0)]
[MacCatalyst (13, 0)]
[Export ("preferredPresentationStyle", ArgumentSemantic.Assign)]
UIPreferredPresentationStyle PreferredPresentationStyle { get; set; }
}
delegate NSProgress RegisterFileRepresentationLoadHandler ([BlockCallback] RegisterFileRepresentationCompletionHandler completionHandler);
delegate void RegisterFileRepresentationCompletionHandler (NSUrl fileUrl, bool coordinated, NSError error);
delegate void ItemProviderDataCompletionHandler (NSData data, NSError error);
delegate NSProgress RegisterDataRepresentationLoadHandler ([BlockCallback] ItemProviderDataCompletionHandler completionHandler);
delegate void LoadInPlaceFileRepresentationHandler (NSUrl fileUrl, bool isInPlace, NSError error);
delegate NSProgress RegisterObjectRepresentationLoadHandler ([BlockCallback] RegisterObjectRepresentationCompletionHandler completionHandler);
delegate void RegisterObjectRepresentationCompletionHandler (INSItemProviderWriting @object, NSError error);
interface INSItemProviderReading {}
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Protocol]
interface NSItemProviderReading
{
// This static method has to be implemented on each class that implements
// this, this is not a capability that exists in C#.
// We are inlining these on each class that implements NSItemProviderReading
// for the sake of the method being callable from C#, for user code, the
// user needs to manually [Export] the selector on a static method, like
// they do for the "layer" property on CALayer subclasses.
//
[Static, Abstract]
[Export ("readableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
string[] ReadableTypeIdentifiers { get; }
[Static, Abstract]
[Export ("objectWithItemProviderData:typeIdentifier:error:")]
[return: NullAllowed]
INSItemProviderReading GetObject (NSData data, string typeIdentifier, [NullAllowed] out NSError outError);
}
interface INSItemProviderWriting {}
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Protocol]
interface NSItemProviderWriting
{
//
// This static method has to be implemented on each class that implements
// this, this is not a capability that exists in C#.
// We are inlining these on each class that implements NSItemProviderWriting
// for the sake of the method being callable from C#, for user code, the
// user needs to manually [Export] the selector on a static method, like
// they do for the "layer" property on CALayer subclasses.
//
[Static, Abstract]
[Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
string[] WritableTypeIdentifiers { get; }
// This is an optional method, which means the generator will inline it in any classes
// that implements this interface. Unfortunately none of the native classes that implements
// the protocol actually implements this method, which means that inlining the method will cause
// introspection to complain (rightly). So comment out this method to avoid generator a lot of unusable API.
// See also https://bugzilla.xamarin.com/show_bug.cgi?id=59308.
//
// [Static]
// [Export ("itemProviderVisibilityForRepresentationWithTypeIdentifier:")]
// NSItemProviderRepresentationVisibility GetItemProviderVisibility (string typeIdentifier);
[Export ("writableTypeIdentifiersForItemProvider", ArgumentSemantic.Copy)]
// 'WritableTypeIdentifiers' is a nicer name, but there's a static property with that name.
string[] WritableTypeIdentifiersForItemProvider { get; }
[Export ("itemProviderVisibilityForRepresentationWithTypeIdentifier:")]
// 'GetItemProviderVisibility' is a nicer name, but there's a static method with that name.
NSItemProviderRepresentationVisibility GetItemProviderVisibilityForTypeIdentifier (string typeIdentifier);
[Abstract]
[Async, Export ("loadDataWithTypeIdentifier:forItemProviderCompletionHandler:")]
[return: NullAllowed]
NSProgress LoadData (string typeIdentifier, Action<NSData, NSError> completionHandler);
}
[Static]
[iOS (8,0), Mac (10,10)]
partial interface NSJavaScriptExtension {
[Field ("NSExtensionJavaScriptPreprocessingResultsKey")]
NSString PreprocessingResultsKey { get; }
[Field ("NSExtensionJavaScriptFinalizeArgumentKey")]
NSString FinalizeArgumentKey { get; }
}
[iOS (8,0), Mac (10,10)]
interface NSTypeIdentifier {
[Field ("NSTypeIdentifierDateText")]
NSString DateText { get; }
[Field ("NSTypeIdentifierAddressText")]
NSString AddressText { get; }
[Field ("NSTypeIdentifierPhoneNumberText")]
NSString PhoneNumberText { get; }
[Field ("NSTypeIdentifierTransitInformationText")]
NSString TransitInformationText { get; }
}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // `init` returns a null handle
interface NSMethodSignature {
[Static]
[Export ("signatureWithObjCTypes:")]
NSMethodSignature FromObjcTypes (IntPtr utf8objctypes);
[Export ("numberOfArguments")]
nuint NumberOfArguments { get; }
[Export ("frameLength")]
nuint FrameLength { get; }
[Export ("methodReturnLength")]
nuint MethodReturnLength { get; }
[Export ("isOneway")]
bool IsOneway { get; }
[Export ("getArgumentTypeAtIndex:")]
IntPtr GetArgumentType (nuint index);
[Export ("methodReturnType")]
IntPtr MethodReturnType { get; }
}
[BaseType (typeof (NSObject), Name="NSJSONSerialization")]
// Objective-C exception thrown. Name: NSInvalidArgumentException Reason: *** +[NSJSONSerialization allocWithZone:]: Do not create instances of NSJSONSerialization in this release
[DisableDefaultCtor]
interface NSJsonSerialization {
[Static]
[Export ("isValidJSONObject:")]
bool IsValidJSONObject (NSObject obj);
[Static]
[Export ("dataWithJSONObject:options:error:")]
NSData Serialize (NSObject obj, NSJsonWritingOptions opt, out NSError error);
[Static]
[Export ("JSONObjectWithData:options:error:")]
NSObject Deserialize (NSData data, NSJsonReadingOptions opt, out NSError error);
[Static]
[Export ("writeJSONObject:toStream:options:error:")]
nint Serialize (NSObject obj, NSOutputStream stream, NSJsonWritingOptions opt, out NSError error);
[Static]
[Export ("JSONObjectWithStream:options:error:")]
NSObject Deserialize (NSInputStream stream, NSJsonReadingOptions opt, out NSError error);
}
[BaseType (typeof (NSIndexSet))]
interface NSMutableIndexSet : NSSecureCoding {
[Export ("initWithIndex:")]
NativeHandle Constructor (nuint index);
[Export ("initWithIndexSet:")]
NativeHandle Constructor (NSIndexSet other);
[Export ("addIndexes:")]
void Add (NSIndexSet other);
[Export ("removeIndexes:")]
void Remove (NSIndexSet other);
[Export ("removeAllIndexes")]
void Clear ();
[Export ("addIndex:")]
void Add (nuint index);
[Export ("removeIndex:")]
void Remove (nuint index);
[Export ("shiftIndexesStartingAtIndex:by:")]
void ShiftIndexes (nuint startIndex, nint delta);
[Export ("addIndexesInRange:")]
void AddIndexesInRange (NSRange range);
[Export ("removeIndexesInRange:")]
void RemoveIndexesInRange (NSRange range);
}
[NoWatch]
[DisableDefaultCtor] // the instance just crash when trying to call selectors
[BaseType (typeof (NSObject), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] { typeof (NSNetServiceDelegate)})]
interface NSNetService {
[DesignatedInitializer]
[Export ("initWithDomain:type:name:port:")]
NativeHandle Constructor (string domain, string type, string name, int /* int, not NSInteger */ port);
[Export ("initWithDomain:type:name:")]
NativeHandle Constructor (string domain, string type, string name);
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSNetServiceDelegate Delegate { get; set; }
#if NET
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, NSString forMode);
// For consistency with other APIs (NSUrlConnection) we call this Unschedule
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, NSString forMode);
#else
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, string forMode);
// For consistency with other APIs (NSUrlConnection) we call this Unschedule
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, string forMode);
#endif
[Wrap ("Schedule (aRunLoop, forMode.GetConstant ()!)")]
void Schedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[Wrap ("Unschedule (aRunLoop, forMode.GetConstant ()!)")]
void Unschedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[Export ("domain", ArgumentSemantic.Copy)]
string Domain { get; }
[Export ("type", ArgumentSemantic.Copy)]
string Type { get; }
[Export ("name", ArgumentSemantic.Copy)]
string Name { get; }
[Export ("addresses", ArgumentSemantic.Copy)]
NSData [] Addresses { get; }
[Export ("port")]
nint Port { get; }
[Export ("publish")]
void Publish ();
[Export ("publishWithOptions:")]
void Publish (NSNetServiceOptions options);
[Export ("resolve")]
[Deprecated (PlatformName.iOS, 2, 0, message : "Use 'Resolve (double)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 4, message : "Use 'Resolve (double)' instead.")]
[NoWatch]
void Resolve ();
[Export ("resolveWithTimeout:")]
void Resolve (double timeOut);
[Export ("stop")]
void Stop ();
[Static, Export ("dictionaryFromTXTRecordData:")]
NSDictionary DictionaryFromTxtRecord (NSData data);
[Static, Export ("dataFromTXTRecordDictionary:")]
NSData DataFromTxtRecord (NSDictionary dictionary);
[Export ("hostName", ArgumentSemantic.Copy)]
string HostName { get; }
[Export ("getInputStream:outputStream:")]
bool GetStreams (out NSInputStream inputStream, out NSOutputStream outputStream);
[Export ("TXTRecordData")]
NSData GetTxtRecordData ();
[Export ("setTXTRecordData:")]
bool SetTxtRecordData (NSData data);
//NSData TxtRecordData { get; set; }
[Export ("startMonitoring")]
void StartMonitoring ();
[Export ("stopMonitoring")]
void StopMonitoring ();
[iOS (7,0), Mac (10,10)]
[Export ("includesPeerToPeer")]
bool IncludesPeerToPeer { get; set; }
}
[NoWatch]
[Model, BaseType (typeof (NSObject))]
[Protocol]
interface NSNetServiceDelegate {
[Export ("netServiceWillPublish:")]
void WillPublish (NSNetService sender);
[Export ("netServiceDidPublish:")]
void Published (NSNetService sender);
[Export ("netService:didNotPublish:"), EventArgs ("NSNetServiceError")]
void PublishFailure (NSNetService sender, NSDictionary errors);
[Export ("netServiceWillResolve:")]
void WillResolve (NSNetService sender);
[Export ("netServiceDidResolveAddress:")]
void AddressResolved (NSNetService sender);
[Export ("netService:didNotResolve:"), EventArgs ("NSNetServiceError")]
void ResolveFailure (NSNetService sender, NSDictionary errors);
[Export ("netServiceDidStop:")]
void Stopped (NSNetService sender);
[Export ("netService:didUpdateTXTRecordData:"), EventArgs ("NSNetServiceData")]
void UpdatedTxtRecordData (NSNetService sender, NSData data);
[iOS (7,0)]
[Export ("netService:didAcceptConnectionWithInputStream:outputStream:"), EventArgs ("NSNetServiceConnection")]
void DidAcceptConnection (NSNetService sender, NSInputStream inputStream, NSOutputStream outputStream);
}
[NoWatch]
[BaseType (typeof (NSObject),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] {typeof (NSNetServiceBrowserDelegate)})]
interface NSNetServiceBrowser {
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSNetServiceBrowserDelegate Delegate { get; set; }
#if NET
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, NSString forMode);
// For consistency with other APIs (NSUrlConnection) we call this Unschedule
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, NSString forMode);
#else
[Export ("scheduleInRunLoop:forMode:")]
void Schedule (NSRunLoop aRunLoop, string forMode);
// For consistency with other APIs (NSUrlConnection) we call this Unschedule
[Export ("removeFromRunLoop:forMode:")]
void Unschedule (NSRunLoop aRunLoop, string forMode);
#endif
[Wrap ("Schedule (aRunLoop, forMode.GetConstant ()!)")]
void Schedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[Wrap ("Unschedule (aRunLoop, forMode.GetConstant ()!)")]
void Unschedule (NSRunLoop aRunLoop, NSRunLoopMode forMode);
[Export ("searchForBrowsableDomains")]
void SearchForBrowsableDomains ();
[Export ("searchForRegistrationDomains")]
void SearchForRegistrationDomains ();
[Export ("searchForServicesOfType:inDomain:")]
void SearchForServices (string type, string domain);
[Export ("stop")]
void Stop ();
[iOS (7,0), Mac(10,10)]
[Export ("includesPeerToPeer")]
bool IncludesPeerToPeer { get; set; }
}
[NoWatch]
[Model, BaseType (typeof (NSObject))]
[Protocol]
interface NSNetServiceBrowserDelegate {
[Export ("netServiceBrowserWillSearch:")]
void SearchStarted (NSNetServiceBrowser sender);
[Export ("netServiceBrowserDidStopSearch:")]
void SearchStopped (NSNetServiceBrowser sender);
[Export ("netServiceBrowser:didNotSearch:"), EventArgs ("NSNetServiceError")]
void NotSearched (NSNetServiceBrowser sender, NSDictionary errors);
[Export ("netServiceBrowser:didFindDomain:moreComing:"), EventArgs ("NSNetDomain")]
void FoundDomain (NSNetServiceBrowser sender, string domain, bool moreComing);
[Export ("netServiceBrowser:didFindService:moreComing:"), EventArgs ("NSNetService")]
void FoundService (NSNetServiceBrowser sender, NSNetService service, bool moreComing);
[Export ("netServiceBrowser:didRemoveDomain:moreComing:"), EventArgs ("NSNetDomain")]
void DomainRemoved (NSNetServiceBrowser sender, string domain, bool moreComing);
[Export ("netServiceBrowser:didRemoveService:moreComing:"), EventArgs ("NSNetService")]
void ServiceRemoved (NSNetServiceBrowser sender, NSNetService service, bool moreComing);
}
[BaseType (typeof (NSObject))]
// Objective-C exception thrown. Name: NSGenericException Reason: *** -[NSConcreteNotification init]: should never be used
[DisableDefaultCtor] // added in iOS7 but header files says "do not invoke; not a valid initializer for this class"
interface NSNotification : NSCoding, NSCopying {
[Export ("name")]
// Null not allowed
string Name { get; }
[Export ("object")]
[NullAllowed]
NSObject Object { get; }
[Export ("userInfo")]
[NullAllowed]
NSDictionary UserInfo { get; }
[Export ("notificationWithName:object:")][Static]
NSNotification FromName (string name, [NullAllowed] NSObject obj);
[Export ("notificationWithName:object:userInfo:")][Static]
NSNotification FromName (string name,[NullAllowed] NSObject obj, [NullAllowed] NSDictionary userInfo);
}
[BaseType (typeof (NSObject))]
interface NSNotificationCenter {
[Static][Export ("defaultCenter", ArgumentSemantic.Strong)]
NSNotificationCenter DefaultCenter { get; }
[Export ("addObserver:selector:name:object:")]
[PostSnippet ("AddObserverToList (observer, aName, anObject);", Optimizable = true)]
void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] NSString aName, [NullAllowed] NSObject anObject);
[Export ("postNotification:")]
void PostNotification (NSNotification notification);
[Export ("postNotificationName:object:")]
void PostNotificationName (string aName, [NullAllowed] NSObject anObject);
[Export ("postNotificationName:object:userInfo:")]
void PostNotificationName (string aName, [NullAllowed] NSObject anObject, [NullAllowed] NSDictionary aUserInfo);
[Export ("removeObserver:")]
[PostSnippet ("RemoveObserversFromList (observer, null, null);", Optimizable = true)]
void RemoveObserver (NSObject observer);
[Export ("removeObserver:name:object:")]
[PostSnippet ("RemoveObserversFromList (observer, aName, anObject);", Optimizable = true)]
void RemoveObserver (NSObject observer, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
[Export ("addObserverForName:object:queue:usingBlock:")]
NSObject AddObserver ([NullAllowed] string name, [NullAllowed] NSObject obj, [NullAllowed] NSOperationQueue queue, Action<NSNotification> handler);
}
[NoiOS][NoTV][NoWatch]
[Mac (10, 10)][MacCatalyst(15, 0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface NSDistributedLock
{
[Static]
[Export ("lockWithPath:")]
[return: NullAllowed]
NSDistributedLock FromPath (string path);
[Export ("initWithPath:")]
[DesignatedInitializer]
NativeHandle Constructor (string path);
[Export ("tryLock")]
bool TryLock ();
[Export ("unlock")]
void Unlock ();
[Export ("breakLock")]
void BreakLock ();
[Export ("lockDate", ArgumentSemantic.Copy)]
NSDate LockDate { get; }
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15, 0)]
[BaseType (typeof (NSNotificationCenter))]
interface NSDistributedNotificationCenter {
[Static]
[Export ("defaultCenter")]
#if NET
NSDistributedNotificationCenter DefaultCenter { get; }
#else
NSDistributedNotificationCenter GetDefaultCenter ();
[Static]
[Advice ("Use 'GetDefaultCenter ()' for a strongly typed version.")]
[Wrap ("GetDefaultCenter ()")]
NSObject DefaultCenter { get; }
#endif
[Export ("addObserver:selector:name:object:suspensionBehavior:")]
void AddObserver (NSObject observer, Selector selector, [NullAllowed] string notificationName, [NullAllowed] string notificationSenderc, NSNotificationSuspensionBehavior suspensionBehavior);
[Export ("postNotificationName:object:userInfo:deliverImmediately:")]
void PostNotificationName (string name, [NullAllowed] string anObject, [NullAllowed] NSDictionary userInfo, bool deliverImmediately);
[Export ("postNotificationName:object:userInfo:options:")]
void PostNotificationName (string name, [NullAllowed] string anObjecb, [NullAllowed] NSDictionary userInfo, NSNotificationFlags options);
[Export ("addObserver:selector:name:object:")]
void AddObserver (NSObject observer, Selector aSelector, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
[Export ("postNotificationName:object:")]
void PostNotificationName (string aName, [NullAllowed] string anObject);
[Export ("postNotificationName:object:userInfo:")]
void PostNotificationName (string aName, [NullAllowed] string anObject, [NullAllowed] NSDictionary aUserInfo);
[Export ("removeObserver:name:object:")]
void RemoveObserver (NSObject observer, [NullAllowed] string aName, [NullAllowed] NSObject anObject);
//Detected properties
[Export ("suspended")]
bool Suspended { get; set; }
[Field ("NSLocalNotificationCenterType")]
NSString NSLocalNotificationCenterType {get;}
}
[BaseType (typeof (NSObject))]
interface NSNotificationQueue {
[Static][IsThreadStatic]
[Export ("defaultQueue", ArgumentSemantic.Strong)]
NSNotificationQueue DefaultQueue { get; }
[DesignatedInitializer]
[Export ("initWithNotificationCenter:")]
NativeHandle Constructor (NSNotificationCenter notificationCenter);
[Export ("enqueueNotification:postingStyle:")]
void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle);
[Export ("enqueueNotification:postingStyle:coalesceMask:forModes:")]
#if !NET
void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle, NSNotificationCoalescing coalesceMask, [NullAllowed] string [] modes);
#else
void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle, NSNotificationCoalescing coalesceMask, [NullAllowed] NSString [] modes);
[Wrap ("EnqueueNotification (notification, postingStyle, coalesceMask, modes?.GetConstants ())")]
void EnqueueNotification (NSNotification notification, NSPostingStyle postingStyle, NSNotificationCoalescing coalesceMask, [NullAllowed] NSRunLoopMode [] modes);
#endif
[Export ("dequeueNotificationsMatching:coalesceMask:")]
void DequeueNotificationsMatchingcoalesceMask (NSNotification notification, NSNotificationCoalescing coalesceMask);
}
[BaseType (typeof (NSObject))]
// init returns NIL
[DisableDefaultCtor]
partial interface NSValue : NSSecureCoding, NSCopying {
[Deprecated (PlatformName.MacOSX, 10, 13, message:"Potential for buffer overruns. Use 'StoreValueAtAddress (IntPtr, nuint)' instead.")]
[Deprecated (PlatformName.iOS, 11, 0, message:"Potential for buffer overruns. Use 'StoreValueAtAddress (IntPtr, nuint)' instead.")]
[Deprecated (PlatformName.TvOS, 11, 0, message:"Potential for buffer overruns. Use 'StoreValueAtAddress (IntPtr, nuint)' instead.")]
[Deprecated (PlatformName.WatchOS, 4, 0, message:"Potential for buffer overruns. Use 'StoreValueAtAddress (IntPtr, nuint)' instead.")]
[Export ("getValue:")]
void StoreValueAtAddress (IntPtr value);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("getValue:size:")]
void StoreValueAtAddress (IntPtr value, nuint size);
[Export ("objCType")][Internal]
IntPtr ObjCTypePtr ();
//[Export ("initWithBytes:objCType:")][Internal]
//NSValue InitFromBytes (IntPtr byte_ptr, IntPtr char_ptr_type);
[Static][Internal]
[Export ("valueWithBytes:objCType:")]
NSValue Create (IntPtr bytes, IntPtr objCType);
[Static]
[Export ("valueWithNonretainedObject:")]
NSValue ValueFromNonretainedObject (NSObject anObject);
[Export ("nonretainedObjectValue")]
NSObject NonretainedObjectValue { get; }
[Static]
[Export ("valueWithPointer:")]
NSValue ValueFromPointer (IntPtr pointer);
[Export ("pointerValue")]
IntPtr PointerValue { get; }
[Export ("isEqualToValue:")]
bool IsEqualTo (NSValue value);
[Export ("valueWithRange:")][Static]
NSValue FromRange(NSRange range);
[Export ("rangeValue")]
NSRange RangeValue { get; }
[Watch (6,0)]
[Static, Export ("valueWithCMTime:")]
NSValue FromCMTime (CMTime time);
[Watch (6,0)]
[Export ("CMTimeValue")]
CMTime CMTimeValue { get; }
[Watch (6,0)]
[Static, Export ("valueWithCMTimeMapping:")]
NSValue FromCMTimeMapping (CMTimeMapping timeMapping);
[Watch (6,0)]
[Export ("CMTimeMappingValue")]
CMTimeMapping CMTimeMappingValue { get; }
[Watch (6,0)]
[Static, Export ("valueWithCMTimeRange:")]
NSValue FromCMTimeRange (CMTimeRange timeRange);
[Watch (6,0)]
[Export ("CMTimeRangeValue")]
CMTimeRange CMTimeRangeValue { get; }
#if MONOMAC
[Export ("valueWithRect:")]
#else
[Export ("valueWithCGRect:")]
#endif
[Static]
NSValue FromCGRect (CGRect rect);
#if MONOMAC
[Export ("valueWithSize:")]
#else
[Export ("valueWithCGSize:")]
#endif
[Static]
NSValue FromCGSize (CGSize size);
#if MONOMAC
[Export ("valueWithPoint:")]
#else
[Export ("valueWithCGPoint:")]
#endif
[Static]
NSValue FromCGPoint (CGPoint point);
#if MONOMAC
[Export ("rectValue")]
#else
[Export ("CGRectValue")]
#endif
CGRect CGRectValue { get; }
#if MONOMAC
[Export ("sizeValue")]
#else
[Export ("CGSizeValue")]
#endif
CGSize CGSizeValue { get; }
#if MONOMAC
[Export ("pointValue")]
#else
[Export ("CGPointValue")]
#endif
CGPoint CGPointValue { get; }
[NoMac]
[Export ("CGAffineTransformValue")]
CoreGraphics.CGAffineTransform CGAffineTransformValue { get; }
[NoMac]
[Export ("UIEdgeInsetsValue")]
UIEdgeInsets UIEdgeInsetsValue { get; }
[NoMac]
[Watch (4,0), TV (11,0), iOS (11,0)]
[Export ("directionalEdgeInsetsValue")]
NSDirectionalEdgeInsets DirectionalEdgeInsetsValue { get; }
[NoMac]
[Export ("valueWithCGAffineTransform:")][Static]
NSValue FromCGAffineTransform (CoreGraphics.CGAffineTransform tran);
[NoMac]
[Export ("valueWithUIEdgeInsets:")][Static]
NSValue FromUIEdgeInsets (UIEdgeInsets insets);
[Watch (4,0), TV (11,0), iOS (11,0)]
[NoMac]
[Static]
[Export ("valueWithDirectionalEdgeInsets:")]
NSValue FromDirectionalEdgeInsets (NSDirectionalEdgeInsets insets);
[Export ("valueWithUIOffset:")][Static]
[NoMac]
NSValue FromUIOffset (UIOffset insets);
[Export ("UIOffsetValue")]
[NoMac]
UIOffset UIOffsetValue { get; }
// from UIGeometry.h - those are in iOS8 only (even if the header is silent about them)
// and not in OSX 10.10
[iOS (8,0)]
[Export ("CGVectorValue")]
[NoMac]
CGVector CGVectorValue { get; }
[iOS (8,0)]
[Static, Export ("valueWithCGVector:")]
[NoMac]
NSValue FromCGVector (CGVector vector);
// Maybe we should include this inside mapkit.cs instead (it's a partial interface, so that's trivial)?
[TV (9,2)]
[Mac (10,9)] // The header doesn't say, but the rest of the API from the same file (MKGeometry.h) was introduced in 10.9
[Static, Export ("valueWithMKCoordinate:")]
NSValue FromMKCoordinate (CoreLocation.CLLocationCoordinate2D coordinate);
[TV (9,2)]
[Mac (10,9)] // The header doesn't say, but the rest of the API from the same file (MKGeometry.h) was introduced in 10.9
[Static, Export ("valueWithMKCoordinateSpan:")]
NSValue FromMKCoordinateSpan (MapKit.MKCoordinateSpan coordinateSpan);
[TV (9,2)]
[Mac (10, 9)]
[Export ("MKCoordinateValue")]
CoreLocation.CLLocationCoordinate2D CoordinateValue { get; }
[TV (9,2)]
[Mac (10, 9)]
[Export ("MKCoordinateSpanValue")]
MapKit.MKCoordinateSpan CoordinateSpanValue { get; }
#if !WATCH
[Export ("valueWithCATransform3D:")][Static]
NSValue FromCATransform3D (CoreAnimation.CATransform3D transform);
[Export ("CATransform3DValue")]
CoreAnimation.CATransform3D CATransform3DValue { get; }
#endif
#region SceneKit Additions
[iOS (8,0)][Mac (10,9)]
[Static, Export ("valueWithSCNVector3:")]
NSValue FromVector (SCNVector3 vector);
[iOS (8,0)][Mac (10,9)]
[Export ("SCNVector3Value")]
SCNVector3 Vector3Value { get; }
[iOS (8,0)][Mac (10,9)]
[Static, Export ("valueWithSCNVector4:")]
NSValue FromVector (SCNVector4 vector);
[iOS (8,0)][Mac (10,9)]
[Export ("SCNVector4Value")]
SCNVector4 Vector4Value { get; }
[iOS (8,0)][Mac (10,10)]
[Static, Export ("valueWithSCNMatrix4:")]
NSValue FromSCNMatrix4 (SCNMatrix4 matrix);
[iOS (8,0)][Mac (10,10)]
[Export ("SCNMatrix4Value")]
SCNMatrix4 SCNMatrix4Value { get; }
#endregion
}
[BaseType (typeof (NSObject))]
[Abstract] // Apple docs: NSValueTransformer is an abstract class...
interface NSValueTransformer {
[Static]
[Export ("setValueTransformer:forName:")]
void SetValueTransformer ([NullAllowed] NSValueTransformer transformer, string name);
[Static]
[Export ("valueTransformerForName:")]
[return: NullAllowed]
NSValueTransformer GetValueTransformer (string name);
[Static]
[Export ("valueTransformerNames")]
string[] ValueTransformerNames { get; }
[Static]
[Export ("transformedValueClass")]
Class TransformedValueClass { get; }
[Static]
[Export ("allowsReverseTransformation")]
bool AllowsReverseTransformation { get; }
[Export ("transformedValue:")]
[return: NullAllowed]
NSObject TransformedValue ([NullAllowed] NSObject value);
[Export ("reverseTransformedValue:")]
[return: NullAllowed]
NSObject ReverseTransformedValue ([NullAllowed] NSObject value);
#if IOS && !NET
[iOS (9, 3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[Notification]
[Obsolete ("Use 'NSUserDefaults.SizeLimitExceededNotification' instead.")]
[Field ("NSUserDefaultsSizeLimitExceededNotification")]
NSString SizeLimitExceededNotification { get; }
[iOS (9, 3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[Notification]
[Obsolete ("Use 'NSUserDefaults.DidChangeAccountsNotification' instead.")]
[Field ("NSUbiquitousUserDefaultsDidChangeAccountsNotification")]
NSString DidChangeAccountsNotification { get; }
[iOS (9, 3)]
[Watch (2,2)] // Headers say watchOS 2.0, but they're lying.
[Notification]
[Obsolete ("Use 'NSUserDefaults.CompletedInitialSyncNotification' instead.")]
[Field ("NSUbiquitousUserDefaultsCompletedInitialSyncNotification")]
NSString CompletedInitialSyncNotification { get; }
[Notification]
[Obsolete ("Use 'NSUserDefaults.DidChangeNotification' instead.")]
[Field ("NSUserDefaultsDidChangeNotification")]
NSString UserDefaultsDidChangeNotification { get; }
#endif
[Field ("NSNegateBooleanTransformerName")]
NSString BooleanTransformerName { get; }
[Field ("NSIsNilTransformerName")]
NSString IsNilTransformerName { get; }
[Field ("NSIsNotNilTransformerName")]
NSString IsNotNilTransformerName { get; }
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Field ("NSUnarchiveFromDataTransformerName")]
NSString UnarchiveFromDataTransformerName { get; }
[Deprecated (PlatformName.TvOS, 12, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'SecureUnarchiveFromDataTransformerName' instead.")]
[Field ("NSKeyedUnarchiveFromDataTransformerName")]
NSString KeyedUnarchiveFromDataTransformerName { get; }
[Watch (5, 0), TV (12, 0), Mac (10, 14), iOS (12, 0)]
[Field ("NSSecureUnarchiveFromDataTransformerName")]
NSString SecureUnarchiveFromDataTransformerName { get; }
}
[Watch (5,0), TV (12,0), Mac (10,14), iOS (12,0)]
[BaseType (typeof(NSValueTransformer))]
interface NSSecureUnarchiveFromDataTransformer {
[Static]
[Export ("allowedTopLevelClasses", ArgumentSemantic.Copy)]
Class [] AllowedTopLevelClasses { get; }
[Static]
[Wrap ("Array.ConvertAll (AllowedTopLevelClasses, c => Class.Lookup (c))")]
Type [] AllowedTopLevelTypes { get; }
}
[BaseType (typeof (NSValue))]
// init returns NIL
[DisableDefaultCtor]
interface NSNumber : CKRecordValue, NSFetchRequestResult {
[Export ("charValue")]
sbyte SByteValue { get; }
[Export ("unsignedCharValue")]
byte ByteValue { get; }
[Export ("shortValue")]
short Int16Value { get; }
[Export ("unsignedShortValue")]
ushort UInt16Value { get; }
[Export ("intValue")]
int Int32Value { get; }
[Export ("unsignedIntValue")]
uint UInt32Value { get; }
[Export ("longValue")]
nint LongValue { get; }
[Export ("unsignedLongValue")]
nuint UnsignedLongValue { get; }
[Export ("longLongValue")]
long Int64Value { get; }
[Export ("unsignedLongLongValue")]
ulong UInt64Value { get; }
[Export ("floatValue")]
float FloatValue { get; } /* float, not CGFloat */
[Export ("doubleValue")]
double DoubleValue { get; }
[Export ("decimalValue")]
NSDecimal NSDecimalValue { get; }
[Export ("boolValue")]
bool BoolValue { get; }
[Export ("integerValue")]
nint NIntValue { get; }
[Export ("unsignedIntegerValue")]
nuint NUIntValue { get; }
[Export ("stringValue")]
string StringValue { get; }
[Export ("compare:")]
nint Compare (NSNumber otherNumber);
[Internal] // Equals(object) or IEquatable<T>'s Equals(NSNumber)
[Export ("isEqualToNumber:")]
bool IsEqualToNumber (NSNumber number);
[Export ("descriptionWithLocale:")]
string DescriptionWithLocale (NSLocale locale);
[DesignatedInitializer]
[Export ("initWithChar:")]
NativeHandle Constructor (sbyte value);
[DesignatedInitializer]
[Export ("initWithUnsignedChar:")]
NativeHandle Constructor (byte value);
[DesignatedInitializer]
[Export ("initWithShort:")]
NativeHandle Constructor (short value);
[DesignatedInitializer]
[Export ("initWithUnsignedShort:")]
NativeHandle Constructor (ushort value);
[DesignatedInitializer]
[Export ("initWithInt:")]
NativeHandle Constructor (int /* int, not NSInteger */ value);
[DesignatedInitializer]
[Export ("initWithUnsignedInt:")]
NativeHandle Constructor (uint /* unsigned int, not NSUInteger */value);
//[Export ("initWithLong:")]
//NativeHandle Constructor (long value);
//
//[Export ("initWithUnsignedLong:")]
//NativeHandle Constructor (ulong value);
[DesignatedInitializer]
[Export ("initWithLongLong:")]
NativeHandle Constructor (long value);
[DesignatedInitializer]
[Export ("initWithUnsignedLongLong:")]
NativeHandle Constructor (ulong value);
[DesignatedInitializer]
[Export ("initWithFloat:")]
NativeHandle Constructor (float /* float, not CGFloat */ value);
[DesignatedInitializer]
[Export ("initWithDouble:")]
NativeHandle Constructor (double value);
[DesignatedInitializer]
[Export ("initWithBool:")]
NativeHandle Constructor (bool value);
[DesignatedInitializer]
[Export ("initWithInteger:")]
NativeHandle Constructor (nint value);
[DesignatedInitializer]
[Export ("initWithUnsignedInteger:")]
NativeHandle Constructor (nuint value);
[Export ("numberWithChar:")][Static]
NSNumber FromSByte (sbyte value);
[Static]
[Export ("numberWithUnsignedChar:")]
NSNumber FromByte (byte value);
[Static]
[Export ("numberWithShort:")]
NSNumber FromInt16 (short value);
[Static]
[Export ("numberWithUnsignedShort:")]
NSNumber FromUInt16 (ushort value);
[Static]
[Export ("numberWithInt:")]
NSNumber FromInt32 (int /* int, not NSInteger */ value);
[Static]
[Export ("numberWithUnsignedInt:")]
NSNumber FromUInt32 (uint /* unsigned int, not NSUInteger */ value);
[Static]
[Export ("numberWithLong:")]
NSNumber FromLong (nint value);
//
[Static]
[Export ("numberWithUnsignedLong:")]
NSNumber FromUnsignedLong (nuint value);
[Static]
[Export ("numberWithLongLong:")]
NSNumber FromInt64 (long value);
[Static]
[Export ("numberWithUnsignedLongLong:")]
NSNumber FromUInt64 (ulong value);
[Static]
[Export ("numberWithFloat:")]
NSNumber FromFloat (float /* float, not CGFloat */ value);
[Static]
[Export ("numberWithDouble:")]
NSNumber FromDouble (double value);
[Static]
[Export ("numberWithBool:")]
NSNumber FromBoolean (bool value);
[Static]
[Export ("numberWithInteger:")]
NSNumber FromNInt (nint value);
[Static]
[Export ("numberWithUnsignedInteger:")]
NSNumber FromNUInt (nuint value);
}
[BaseType (typeof (NSFormatter))]
interface NSNumberFormatter {
[Export ("stringFromNumber:")]
string StringFromNumber (NSNumber number);
[Export ("numberFromString:")]
NSNumber NumberFromString (string text);
[Static]
[Export ("localizedStringFromNumber:numberStyle:")]
string LocalizedStringFromNumbernumberStyle (NSNumber num, NSNumberFormatterStyle nstyle);
//Detected properties
[Export ("numberStyle")]
NSNumberFormatterStyle NumberStyle { get; set; }
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("generatesDecimalNumbers")]
bool GeneratesDecimalNumbers { get; set; }
[Export ("formatterBehavior")]
NSNumberFormatterBehavior FormatterBehavior { get; set; }
[Static]
[Export ("defaultFormatterBehavior")]
NSNumberFormatterBehavior DefaultFormatterBehavior { get; set; }
[Export ("negativeFormat")]
string NegativeFormat { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForNegativeValues", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForNegativeValues { get; set; }
[Export ("positiveFormat")]
string PositiveFormat { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForPositiveValues", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForPositiveValues { get; set; }
[Export ("allowsFloats")]
bool AllowsFloats { get; set; }
[Export ("decimalSeparator")]
string DecimalSeparator { get; set; }
[Export ("alwaysShowsDecimalSeparator")]
bool AlwaysShowsDecimalSeparator { get; set; }
[Export ("currencyDecimalSeparator")]
string CurrencyDecimalSeparator { get; set; }
[Export ("usesGroupingSeparator")]
bool UsesGroupingSeparator { get; set; }
[Export ("groupingSeparator")]
string GroupingSeparator { get; set; }
[NullAllowed] // by default this property is null
[Export ("zeroSymbol")]
string ZeroSymbol { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForZero", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForZero { get; set; }
[Export ("nilSymbol")]
string NilSymbol { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForNil", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForNil { get; set; }
[Export ("notANumberSymbol")]
string NotANumberSymbol { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForNotANumber", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForNotANumber { get; set; }
[Export ("positiveInfinitySymbol")]
string PositiveInfinitySymbol { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForPositiveInfinity", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForPositiveInfinity { get; set; }
[Export ("negativeInfinitySymbol")]
string NegativeInfinitySymbol { get; set; }
[NullAllowed] // by default this property is null
[Export ("textAttributesForNegativeInfinity", ArgumentSemantic.Copy)]
NSDictionary TextAttributesForNegativeInfinity { get; set; }
[Export ("positivePrefix")]
string PositivePrefix { get; set; }
[Export ("positiveSuffix")]
string PositiveSuffix { get; set; }
[Export ("negativePrefix")]
string NegativePrefix { get; set; }
[Export ("negativeSuffix")]
string NegativeSuffix { get; set; }
[Export ("currencyCode")]
string CurrencyCode { get; set; }
[Export ("currencySymbol")]
string CurrencySymbol { get; set; }
[Export ("internationalCurrencySymbol")]
string InternationalCurrencySymbol { get; set; }
[Export ("percentSymbol")]
string PercentSymbol { get; set; }
[Export ("perMillSymbol")]
string PerMillSymbol { get; set; }
[Export ("minusSign")]
string MinusSign { get; set; }
[Export ("plusSign")]
string PlusSign { get; set; }
[Export ("exponentSymbol")]
string ExponentSymbol { get; set; }
[Export ("groupingSize")]
nuint GroupingSize { get; set; }
[Export ("secondaryGroupingSize")]
nuint SecondaryGroupingSize { get; set; }
[NullAllowed] // by default this property is null
[Export ("multiplier", ArgumentSemantic.Copy)]
NSNumber Multiplier { get; set; }
[Export ("formatWidth")]
nuint FormatWidth { get; set; }
[Export ("paddingCharacter")]
string PaddingCharacter { get; set; }
[Export ("paddingPosition")]
NSNumberFormatterPadPosition PaddingPosition { get; set; }
[Export ("roundingMode")]
NSNumberFormatterRoundingMode RoundingMode { get; set; }
[Export ("roundingIncrement", ArgumentSemantic.Copy)]
NSNumber RoundingIncrement { get; set; }
[Export ("minimumIntegerDigits")]
nint MinimumIntegerDigits { get; set; }
[Export ("maximumIntegerDigits")]
nint MaximumIntegerDigits { get; set; }
[Export ("minimumFractionDigits")]
nint MinimumFractionDigits { get; set; }
[Export ("maximumFractionDigits")]
nint MaximumFractionDigits { get; set; }
[NullAllowed] // by default this property is null
[Export ("minimum", ArgumentSemantic.Copy)]
NSNumber Minimum { get; set; }
[NullAllowed] // by default this property is null
[Export ("maximum", ArgumentSemantic.Copy)]
NSNumber Maximum { get; set; }
[Export ("currencyGroupingSeparator")]
string CurrencyGroupingSeparator { get; set; }
[Export ("lenient")]
bool Lenient { [Bind ("isLenient")]get; set; }
[Export ("usesSignificantDigits")]
bool UsesSignificantDigits { get; set; }
[Export ("minimumSignificantDigits")]
nuint MinimumSignificantDigits { get; set; }
[Export ("maximumSignificantDigits")]
nuint MaximumSignificantDigits { get; set; }
[Export ("partialStringValidationEnabled")]
bool PartialStringValidationEnabled { [Bind ("isPartialStringValidationEnabled")]get; set; }
}
[BaseType (typeof (NSNumber))]
interface NSDecimalNumber : NSSecureCoding {
[Export ("initWithMantissa:exponent:isNegative:")]
NativeHandle Constructor (long mantissa, short exponent, bool isNegative);
[DesignatedInitializer]
[Export ("initWithDecimal:")]
NativeHandle Constructor (NSDecimal dec);
[Export ("initWithString:")]
NativeHandle Constructor (string numberValue);
[Export ("initWithString:locale:")]
NativeHandle Constructor (string numberValue, NSObject locale);
[Export ("descriptionWithLocale:")]
[Override]
string DescriptionWithLocale (NSLocale locale);
[Export ("decimalValue")]
NSDecimal NSDecimalValue { get; }
[Export ("zero", ArgumentSemantic.Copy)][Static]
NSDecimalNumber Zero { get; }
[Export ("one", ArgumentSemantic.Copy)][Static]
NSDecimalNumber One { get; }
[Export ("minimumDecimalNumber", ArgumentSemantic.Copy)][Static]
NSDecimalNumber MinValue { get; }
[Export ("maximumDecimalNumber", ArgumentSemantic.Copy)][Static]
NSDecimalNumber MaxValue { get; }
[Export ("notANumber", ArgumentSemantic.Copy)][Static]
NSDecimalNumber NaN { get; }
//
// All the behavior ones require:
// id <NSDecimalNumberBehaviors>)behavior;
[Export ("decimalNumberByAdding:")]
NSDecimalNumber Add (NSDecimalNumber d);
[Export ("decimalNumberByAdding:withBehavior:")]
NSDecimalNumber Add (NSDecimalNumber d, NSObject Behavior);
[Export ("decimalNumberBySubtracting:")]
NSDecimalNumber Subtract (NSDecimalNumber d);
[Export ("decimalNumberBySubtracting:withBehavior:")]
NSDecimalNumber Subtract (NSDecimalNumber d, NSObject Behavior);
[Export ("decimalNumberByMultiplyingBy:")]
NSDecimalNumber Multiply (NSDecimalNumber d);
[Export ("decimalNumberByMultiplyingBy:withBehavior:")]
NSDecimalNumber Multiply (NSDecimalNumber d, NSObject Behavior);
[Export ("decimalNumberByDividingBy:")]
NSDecimalNumber Divide (NSDecimalNumber d);
[Export ("decimalNumberByDividingBy:withBehavior:")]
NSDecimalNumber Divide (NSDecimalNumber d, NSObject Behavior);
[Export ("decimalNumberByRaisingToPower:")]
NSDecimalNumber RaiseTo (nuint power);
[Export ("decimalNumberByRaisingToPower:withBehavior:")]
NSDecimalNumber RaiseTo (nuint power, [NullAllowed] NSObject Behavior);
[Export ("decimalNumberByMultiplyingByPowerOf10:")]
NSDecimalNumber MultiplyPowerOf10 (short power);
[Export ("decimalNumberByMultiplyingByPowerOf10:withBehavior:")]
NSDecimalNumber MultiplyPowerOf10 (short power, [NullAllowed] NSObject Behavior);
[Export ("decimalNumberByRoundingAccordingToBehavior:")]
NSDecimalNumber Rounding (NSObject behavior);
[Export ("compare:")]
[Override]
nint Compare (NSNumber other);
[Export ("defaultBehavior", ArgumentSemantic.Strong)][Static]
NSObject DefaultBehavior { get; set; }
[Export ("doubleValue")]
[Override]
double DoubleValue { get; }
}
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSThread {
[Static, Export ("currentThread", ArgumentSemantic.Strong)]
NSThread Current { get; }
[Static, Export ("callStackSymbols", ArgumentSemantic.Copy)]
string [] NativeCallStack { get; }
//+ (void)detachNewThreadSelector:(SEL)selector toTarget:(id)target withObject:(id)argument;
[Static, Export ("isMultiThreaded")]
bool IsMultiThreaded { get; }
//- (NSMutableDictionary *)threadDictionary;
[Static, Export ("sleepUntilDate:")]
void SleepUntil (NSDate date);
[Static, Export ("sleepForTimeInterval:")]
void SleepFor (double timeInterval);
[Static, Export ("exit")]
void Exit ();
[Static, Export ("threadPriority"), Internal]
double _GetPriority ();
[Static, Export ("setThreadPriority:"), Internal]
bool _SetPriority (double priority);
//+ (NSArray *)callStackReturnAddresses;
[NullAllowed] // by default this property is null
[Export ("name")]
string Name { get; set; }
[Export ("stackSize")]
nuint StackSize { get; set; }
[Export ("isMainThread")]
bool IsMainThread { get; }
// MainThread is already used for the instance selector and we can't reuse the same name
[Static]
[Export ("isMainThread")]
bool IsMain { get; }
[Static]
[Export ("mainThread", ArgumentSemantic.Strong)]
NSThread MainThread { get; }
[Export ("isExecuting")]
bool IsExecuting { get; }
[Export ("isFinished")]
bool IsFinished { get; }
[Export ("isCancelled")]
bool IsCancelled { get; }
[Export ("cancel")]
void Cancel ();
[Export ("start")]
void Start ();
[Export ("main")]
void Main ();
[Mac (10,10), iOS (8,0)]
[Export ("qualityOfService")]
NSQualityOfService QualityOfService { get; set; }
}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSPort : NSCoding, NSCopying {
[Static, Export ("port")]
NSPort Create ();
[Export ("invalidate")]
void Invalidate ();
[Export ("isValid")]
bool IsValid { get; }
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate"), NullAllowed]
[Protocolize]
NSPortDelegate Delegate { get; set; }
[Export ("scheduleInRunLoop:forMode:")]
void ScheduleInRunLoop (NSRunLoop runLoop, NSString runLoopMode);
[Wrap ("ScheduleInRunLoop (runLoop, runLoopMode.GetConstant ()!)")]
void ScheduleInRunLoop (NSRunLoop runLoop, NSRunLoopMode runLoopMode);
[Export ("removeFromRunLoop:forMode:")]
void RemoveFromRunLoop (NSRunLoop runLoop, NSString runLoopMode);
[Wrap ("RemoveFromRunLoop (runLoop, runLoopMode.GetConstant ()!)")]
void RemoveFromRunLoop (NSRunLoop runLoop, NSRunLoopMode runLoopMode);
// Disable warning for NSMutableArray
#pragma warning disable 618
[Export ("sendBeforeDate:components:from:reserved:")]
bool SendBeforeDate (NSDate limitDate, [NullAllowed] NSMutableArray components, [NullAllowed] NSPort receivePort, nuint headerSpaceReserved);
[Export ("sendBeforeDate:msgid:components:from:reserved:")]
bool SendBeforeDate (NSDate limitDate, nuint msgID, [NullAllowed] NSMutableArray components, [NullAllowed] NSPort receivePort, nuint headerSpaceReserved);
#pragma warning restore 618
}
[Model, BaseType (typeof (NSObject))]
[Protocol]
interface NSPortDelegate {
[NoMacCatalyst]
[Export ("handlePortMessage:")]
void MessageReceived (NSPortMessage message);
}
[BaseType (typeof (NSObject))]
[MacCatalyst(15, 0)]
interface NSPortMessage {
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[DesignatedInitializer]
[Export ("initWithSendPort:receivePort:components:")]
NativeHandle Constructor (NSPort sendPort, NSPort recvPort, NSArray components);
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[Export ("components")]
NSArray Components { get; }
// Apple started refusing applications that use those selectors (desk #63237)
// The situation is a bit confusing since NSPortMessage.h is not part of iOS SDK -
// but the type is used (from NSPort[Delegate]) but not _itself_ documented
// The selectors Apple *currently* dislike are removed from the iOS build
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[Export ("sendBeforeDate:")]
bool SendBefore (NSDate date);
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[Export ("receivePort")]
NSPort ReceivePort { get; }
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[Export ("sendPort")]
NSPort SendPort { get; }
[NoiOS][NoWatch][NoTV][MacCatalyst(15, 0)]
[Export ("msgid")]
uint MsgId { get; set; } /* uint32_t */
}
[BaseType (typeof (NSPort))]
interface NSMachPort {
[DesignatedInitializer]
[Export ("initWithMachPort:")]
NativeHandle Constructor (uint /* uint32_t */ machPort);
[DesignatedInitializer]
[Export ("initWithMachPort:options:")]
NativeHandle Constructor (uint /* uint32_t */ machPort, NSMachPortRights options);
[Static, Export ("portWithMachPort:")]
NSPort FromMachPort (uint /* uint32_t */ port);
[Static, Export ("portWithMachPort:options:")]
NSPort FromMachPort (uint /* uint32_t */ port, NSMachPortRights options);
[Export ("machPort")]
uint MachPort { get; } /* uint32_t */
[Export ("removeFromRunLoop:forMode:")]
[Override]
void RemoveFromRunLoop (NSRunLoop runLoop, NSString mode);
// note: wrap'ed version using NSRunLoopMode will call the override
[Export ("scheduleInRunLoop:forMode:")]
[Override]
void ScheduleInRunLoop (NSRunLoop runLoop, NSString mode);
// note: wrap'ed version using NSRunLoopMode will call the override
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
[Override]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate"), NullAllowed]
[Protocolize]
NSMachPortDelegate Delegate { get; set; }
}
[Model, BaseType (typeof (NSPortDelegate))]
[Protocol]
interface NSMachPortDelegate {
[Export ("handleMachMessage:")]
void MachMessageReceived (IntPtr msgHeader);
}
[BaseType (typeof (NSObject))]
interface NSProcessInfo {
[Export ("processInfo", ArgumentSemantic.Strong)][Static]
NSProcessInfo ProcessInfo { get; }
[Export ("arguments")]
string [] Arguments { get; }
[Export ("environment")]
NSDictionary Environment { get; }
[Export ("processIdentifier")]
int ProcessIdentifier { get; } /* int, not NSInteger */
[Export ("globallyUniqueString")]
string GloballyUniqueString { get; }
[Export ("processName")]
string ProcessName { get; set; }
[Export ("hostName")]
string HostName { get; }
[Deprecated (PlatformName.MacOSX, 10, 10, message : "Use 'OperatingSystemVersion' or 'IsOperatingSystemAtLeastVersion' instead.")]
[Deprecated (PlatformName.iOS, 8, 0, message : "Use 'OperatingSystemVersion' or 'IsOperatingSystemAtLeastVersion' instead.")]
[Export ("operatingSystem")]
nint OperatingSystem { get; }
[Deprecated (PlatformName.MacOSX, 10, 10, message : "Use 'OperatingSystemVersionString' instead.")]
[Deprecated (PlatformName.iOS, 8, 0, message : "Use 'OperatingSystemVersionString' instead.")]
[Export ("operatingSystemName")]
string OperatingSystemName { get; }
[Export ("operatingSystemVersionString")]
string OperatingSystemVersionString { get; }
[Export ("physicalMemory")]
ulong PhysicalMemory { get; }
[Export ("processorCount")]
nint ProcessorCount { get; }
[Export ("activeProcessorCount")]
nint ActiveProcessorCount { get; }
[Export ("systemUptime")]
double SystemUptime { get; }
[iOS (7,0), Mac (10, 9)]
[Export ("beginActivityWithOptions:reason:")]
NSObject BeginActivity (NSActivityOptions options, string reason);
[iOS (7,0), Mac (10, 9)]
[Export ("endActivity:")]
void EndActivity (NSObject activity);
[iOS (7,0), Mac (10, 9)]
[Export ("performActivityWithOptions:reason:usingBlock:")]
void PerformActivity (NSActivityOptions options, string reason, Action runCode);
[Mac (10,10)]
[iOS (8,0)]
[Export ("isOperatingSystemAtLeastVersion:")]
bool IsOperatingSystemAtLeastVersion (NSOperatingSystemVersion version);
[Mac (10,10)]
[iOS (8,0)]
[Export ("operatingSystemVersion")]
NSOperatingSystemVersion OperatingSystemVersion { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("enableSuddenTermination")]
void EnableSuddenTermination ();
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("disableSuddenTermination")]
void DisableSuddenTermination ();
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("enableAutomaticTermination:")]
void EnableAutomaticTermination (string reason);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("disableAutomaticTermination:")]
void DisableAutomaticTermination (string reason);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("automaticTerminationSupportEnabled")]
bool AutomaticTerminationSupportEnabled { get; set; }
[NoMac]
[iOS (8,2)]
[Export ("performExpiringActivityWithReason:usingBlock:")]
void PerformExpiringActivity (string reason, Action<bool> block);
[NoMac]
[iOS (9,0)]
[Export ("lowPowerModeEnabled")]
bool LowPowerModeEnabled { [Bind ("isLowPowerModeEnabled")] get; }
[NoMac]
[iOS (9,0)]
[Notification]
[Field ("NSProcessInfoPowerStateDidChangeNotification")]
NSString PowerStateDidChangeNotification { get; }
[Mac (10,10,3)]
[Watch (4,0)]
[TV (11, 0)]
[iOS (11,0)]
[Export ("thermalState")]
NSProcessInfoThermalState ThermalState { get; }
[Mac (10,10,3)]
[Field ("NSProcessInfoThermalStateDidChangeNotification")]
[Watch (4,0)]
[TV (11, 0)]
[iOS (11,0)]
[Notification]
NSString ThermalStateDidChangeNotification { get; }
#region NSProcessInfoPlatform (NSProcessInfo)
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("macCatalystApp")]
bool IsMacCatalystApplication { [Bind ("isMacCatalystApp")] get; }
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Export ("iOSAppOnMac")]
bool IsiOSApplicationOnMac { [Bind ("isiOSAppOnMac")] get; }
#endregion
}
[NoWatch][NoTV][NoiOS]
[Mac (10,12)]
[Category]
[BaseType (typeof (NSProcessInfo))]
interface NSProcessInfo_NSUserInformation {
[Export ("userName")]
string GetUserName ();
[Export ("fullUserName")]
string GetFullUserName ();
}
[iOS (7,0), Mac (10, 9)]
[BaseType (typeof (NSObject))]
partial interface NSProgress {
[Static, Export ("currentProgress")]
NSProgress CurrentProgress { get; }
[Static, Export ("progressWithTotalUnitCount:")]
NSProgress FromTotalUnitCount (long unitCount);
[iOS (9,0), Mac (10,11)]
[Static, Export ("discreteProgressWithTotalUnitCount:")]
NSProgress GetDiscreteProgress (long unitCount);
[iOS (9,0), Mac (10,11)]
[Static, Export ("progressWithTotalUnitCount:parent:pendingUnitCount:")]
NSProgress FromTotalUnitCount (long unitCount, NSProgress parent, long portionOfParentTotalUnitCount);
[DesignatedInitializer]
[Export ("initWithParent:userInfo:")]
NativeHandle Constructor ([NullAllowed] NSProgress parentProgress, [NullAllowed] NSDictionary userInfo);
[Export ("becomeCurrentWithPendingUnitCount:")]
void BecomeCurrent (long pendingUnitCount);
[Export ("resignCurrent")]
void ResignCurrent ();
[iOS (9,0), Mac (10,11)]
[Export ("addChild:withPendingUnitCount:")]
void AddChild (NSProgress child, long pendingUnitCount);
[Export ("totalUnitCount")]
long TotalUnitCount { get; set; }
[Export ("completedUnitCount")]
long CompletedUnitCount { get; set; }
[Export ("localizedDescription", ArgumentSemantic.Copy), NullAllowed]
string LocalizedDescription { get; set; }
[Export ("localizedAdditionalDescription", ArgumentSemantic.Copy), NullAllowed]
string LocalizedAdditionalDescription { get; set; }
[Export ("cancellable")]
bool Cancellable { [Bind ("isCancellable")] get; set; }
[Export ("pausable")]
bool Pausable { [Bind ("isPausable")] get; set; }
[Export ("cancelled")]
bool Cancelled { [Bind ("isCancelled")] get; }
[Export ("paused")]
bool Paused { [Bind ("isPaused")] get; }
[Export ("setCancellationHandler:")]
void SetCancellationHandler (Action handler);
[Export ("setPausingHandler:")]
void SetPauseHandler (Action handler);
[iOS (9,0), Mac (10,11)]
[Export ("setResumingHandler:")]
void SetResumingHandler (Action handler);
[Export ("setUserInfoObject:forKey:")]
void SetUserInfo ([NullAllowed] NSObject obj, NSString key);
[Export ("indeterminate")]
bool Indeterminate { [Bind ("isIndeterminate")] get; }
[Export ("fractionCompleted")]
double FractionCompleted { get; }
[Export ("cancel")]
void Cancel ();
[Export ("pause")]
void Pause ();
[iOS (9,0), Mac (10,11)]
[Export ("resume")]
void Resume ();
[Export ("userInfo")]
NSDictionary UserInfo { get; }
[NullAllowed] // by default this property is null
[Export ("kind", ArgumentSemantic.Copy)]
NSString Kind { get; set; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("publish")]
void Publish ();
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("unpublish")]
void Unpublish ();
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("setAcknowledgementHandler:forAppBundleIdentifier:")]
void SetAcknowledgementHandler (Action<bool> acknowledgementHandler, string appBundleIdentifier);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Static, Export ("addSubscriberForFileURL:withPublishingHandler:")]
NSObject AddSubscriberForFile (NSUrl url, Action<NSProgress> publishingHandler);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Static, Export ("removeSubscriber:")]
void RemoveSubscriber (NSObject subscriber);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("acknowledgeWithSuccess:")]
void AcknowledgeWithSuccess (bool success);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("old")]
bool Old { [Bind ("isOld")] get; }
[Field ("NSProgressKindFile")]
NSString KindFile { get; }
[Field ("NSProgressEstimatedTimeRemainingKey")]
NSString EstimatedTimeRemainingKey { get; }
[Field ("NSProgressThroughputKey")]
NSString ThroughputKey { get; }
[Field ("NSProgressFileOperationKindKey")]
NSString FileOperationKindKey { get; }
[Field ("NSProgressFileOperationKindDownloading")]
NSString FileOperationKindDownloading { get; }
[Field ("NSProgressFileOperationKindDecompressingAfterDownloading")]
NSString FileOperationKindDecompressingAfterDownloading { get; }
[Field ("NSProgressFileOperationKindReceiving")]
NSString FileOperationKindReceiving { get; }
[Field ("NSProgressFileOperationKindCopying")]
NSString FileOperationKindCopying { get; }
[Watch (7,4), TV (14,5), Mac (11,3), iOS (14,5)]
[Field ("NSProgressFileOperationKindUploading")]
NSString FileOperationKindUploading { get; }
[Field ("NSProgressFileURLKey")]
NSString FileURLKey { get; }
[Field ("NSProgressFileTotalCountKey")]
NSString FileTotalCountKey { get; }
[Field ("NSProgressFileCompletedCountKey")]
NSString FileCompletedCountKey { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSProgressFileAnimationImageKey")]
NSString FileAnimationImageKey { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSProgressFileAnimationImageOriginalRectKey")]
NSString FileAnimationImageOriginalRectKey { get; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Field ("NSProgressFileIconKey")]
NSString FileIconKey { get; }
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Async, Export ("performAsCurrentWithPendingUnitCount:usingBlock:")]
void PerformAsCurrent (long unitCount, Action work);
[Export ("finished")]
bool Finished { [Bind ("isFinished")] get; }
[Internal]
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("estimatedTimeRemaining", ArgumentSemantic.Copy)]
//[BindAs (typeof (nint?))]
NSNumber _EstimatedTimeRemaining { get; set; }
[Internal]
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("throughput", ArgumentSemantic.Copy)]
//[BindAs (typeof (nint?))]
NSNumber _Throughput { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("fileOperationKind")]
string FileOperationKind { get; set; }
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("fileURL", ArgumentSemantic.Copy)]
NSUrl FileUrl { get; set; }
[Internal]
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("fileTotalCount", ArgumentSemantic.Copy)]
//[BindAs (typeof (nint?))]
NSNumber _FileTotalCount { get; set; }
[Internal]
[Watch (4, 0), TV (11, 0), Mac (10, 13), iOS (11, 0)]
[NullAllowed, Export ("fileCompletedCount", ArgumentSemantic.Copy)]
//[BindAs (typeof (nint?))]
NSNumber _FileCompletedCount { get; set; }
}
interface INSProgressReporting {}
[iOS (9,0)][Mac (10,11)]
[Protocol]
interface NSProgressReporting {
#if NET
[Abstract]
#endif
[Export ("progress")]
NSProgress Progress { get; }
}
[BaseType (typeof (NSMutableData))]
interface NSPurgeableData : NSSecureCoding, NSMutableCopying, NSDiscardableContent {
}
[Protocol]
interface NSDiscardableContent {
[Abstract]
[Export ("beginContentAccess")]
bool BeginContentAccess ();
[Abstract]
[Export ("endContentAccess")]
void EndContentAccess ();
[Abstract]
[Export ("discardContentIfPossible")]
void DiscardContentIfPossible ();
[Abstract]
[Export ("isContentDiscarded")]
bool IsContentDiscarded { get; }
}
delegate void NSFileCoordinatorWorkerRW (NSUrl newReadingUrl, NSUrl newWritingUrl);
interface INSFilePresenter {}
[BaseType (typeof (NSObject))]
interface NSFileCoordinator {
[Static, Export ("addFilePresenter:")][PostGet ("FilePresenters")]
void AddFilePresenter ([Protocolize] NSFilePresenter filePresenter);
[Static]
[Export ("removeFilePresenter:")][PostGet ("FilePresenters")]
void RemoveFilePresenter ([Protocolize] NSFilePresenter filePresenter);
[Static]
[Export ("filePresenters", ArgumentSemantic.Copy)]
[Protocolize]
NSFilePresenter [] FilePresenters { get; }
[DesignatedInitializer]
[Export ("initWithFilePresenter:")]
NativeHandle Constructor ([NullAllowed] INSFilePresenter filePresenterOrNil);
#if !NET
[Obsolete ("Use '.ctor(INSFilePresenter)' instead.")]
[Wrap ("this (filePresenterOrNil as INSFilePresenter)")]
NativeHandle Constructor ([NullAllowed] NSFilePresenter filePresenterOrNil);
#endif
[Export ("coordinateReadingItemAtURL:options:error:byAccessor:")]
void CoordinateRead (NSUrl itemUrl, NSFileCoordinatorReadingOptions options, out NSError error, /* non null */ Action<NSUrl> worker);
[Export ("coordinateWritingItemAtURL:options:error:byAccessor:")]
void CoordinateWrite (NSUrl url, NSFileCoordinatorWritingOptions options, out NSError error, /* non null */ Action<NSUrl> worker);
[Export ("coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:")]
void CoordinateReadWrite (NSUrl readingURL, NSFileCoordinatorReadingOptions readingOptions, NSUrl writingURL, NSFileCoordinatorWritingOptions writingOptions, out NSError error, /* non null */ NSFileCoordinatorWorkerRW readWriteWorker);
[Export ("coordinateWritingItemAtURL:options:writingItemAtURL:options:error:byAccessor:")]
void CoordinateWriteWrite (NSUrl writingURL, NSFileCoordinatorWritingOptions writingOptions, NSUrl writingURL2, NSFileCoordinatorWritingOptions writingOptions2, out NSError error, /* non null */ NSFileCoordinatorWorkerRW writeWriteWorker);
#if !NET
[Obsolete ("Use 'CoordinateBatch' instead.")]
[Wrap ("CoordinateBatch (readingURLs, readingOptions, writingURLs, writingOptions, out error, batchHandler)", IsVirtual = true)]
void CoordinateBatc (NSUrl [] readingURLs, NSFileCoordinatorReadingOptions readingOptions, NSUrl [] writingURLs, NSFileCoordinatorWritingOptions writingOptions, out NSError error, /* non null */ Action batchHandler);
#endif
[Export ("prepareForReadingItemsAtURLs:options:writingItemsAtURLs:options:error:byAccessor:")]
void CoordinateBatch (NSUrl [] readingURLs, NSFileCoordinatorReadingOptions readingOptions, NSUrl [] writingURLs, NSFileCoordinatorWritingOptions writingOptions, out NSError error, /* non null */ Action batchHandler);
[iOS (8,0)][Mac (10,10)]
[Export ("coordinateAccessWithIntents:queue:byAccessor:")]
void CoordinateAccess (NSFileAccessIntent [] intents, NSOperationQueue executionQueue, Action<NSError> accessor);
[Export ("itemAtURL:didMoveToURL:")]
void ItemMoved (NSUrl fromUrl, NSUrl toUrl);
[Export ("cancel")]
void Cancel ();
[Export ("itemAtURL:willMoveToURL:")]
void WillMove (NSUrl oldUrl, NSUrl newUrl);
[Export ("purposeIdentifier")]
string PurposeIdentifier { get; set; }
[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[Export ("itemAtURL:didChangeUbiquityAttributes:")]
void ItemUbiquityAttributesChanged (NSUrl url, NSSet<NSString> attributes);
}
[iOS (8,0)][Mac (10,10)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSFileAccessIntent {
[Export ("URL", ArgumentSemantic.Copy)]
NSUrl Url { get; }
[Static, Export ("readingIntentWithURL:options:")]
NSFileAccessIntent CreateReadingIntent (NSUrl url, NSFileCoordinatorReadingOptions options);
[Static, Export ("writingIntentWithURL:options:")]
NSFileAccessIntent CreateWritingIntent (NSUrl url, NSFileCoordinatorWritingOptions options);
}
[BaseType (typeof (NSObject))]
partial interface NSFileManager {
[Field("NSFileType")]
NSString NSFileType { get; }
[Field("NSFileTypeDirectory")]
NSString TypeDirectory { get; }
[Field("NSFileTypeRegular")]
NSString TypeRegular { get; }
[Field("NSFileTypeSymbolicLink")]
NSString TypeSymbolicLink { get; }
[Field("NSFileTypeSocket")]
NSString TypeSocket { get; }
[Field("NSFileTypeCharacterSpecial")]
NSString TypeCharacterSpecial { get; }
[Field("NSFileTypeBlockSpecial")]
NSString TypeBlockSpecial { get; }
[Field("NSFileTypeUnknown")]
NSString TypeUnknown { get; }
[Field("NSFileSize")]
NSString Size { get; }
[Field("NSFileModificationDate")]
NSString ModificationDate { get; }
[Field("NSFileReferenceCount")]
NSString ReferenceCount { get; }
[Field("NSFileDeviceIdentifier")]
NSString DeviceIdentifier { get; }
[Field("NSFileOwnerAccountName")]
NSString OwnerAccountName { get; }
[Field("NSFileGroupOwnerAccountName")]
NSString GroupOwnerAccountName { get; }
[Field("NSFilePosixPermissions")]
NSString PosixPermissions { get; }
[Field("NSFileSystemNumber")]
NSString SystemNumber { get; }
[Field("NSFileSystemFileNumber")]
NSString SystemFileNumber { get; }
[Field("NSFileExtensionHidden")]
NSString ExtensionHidden { get; }
[Field("NSFileHFSCreatorCode")]
NSString HfsCreatorCode { get; }
[Field("NSFileHFSTypeCode")]
NSString HfsTypeCode { get; }
[Field("NSFileImmutable")]
NSString Immutable { get; }
[Field("NSFileAppendOnly")]
NSString AppendOnly { get; }
[Field("NSFileCreationDate")]
NSString CreationDate { get; }
[Field("NSFileOwnerAccountID")]
NSString OwnerAccountID { get; }
[Field("NSFileGroupOwnerAccountID")]
NSString GroupOwnerAccountID { get; }
[Field("NSFileBusy")]
NSString Busy { get; }
[Mac (11,0)]
[Field ("NSFileProtectionKey")]
NSString FileProtectionKey { get; }
[Mac (11,0)]
[Field ("NSFileProtectionNone")]
NSString FileProtectionNone { get; }
[Mac (11,0)]
[Field ("NSFileProtectionComplete")]
NSString FileProtectionComplete { get; }
[Mac (11,0)]
[Field ("NSFileProtectionCompleteUnlessOpen")]
NSString FileProtectionCompleteUnlessOpen { get; }
[Mac (11,0)]
[Field ("NSFileProtectionCompleteUntilFirstUserAuthentication")]
NSString FileProtectionCompleteUntilFirstUserAuthentication { get; }
[Field("NSFileSystemSize")]
NSString SystemSize { get; }
[Field("NSFileSystemFreeSize")]
NSString SystemFreeSize { get; }
[Field("NSFileSystemNodes")]
NSString SystemNodes { get; }
[Field("NSFileSystemFreeNodes")]
NSString SystemFreeNodes { get; }
[Static, Export ("defaultManager", ArgumentSemantic.Strong)]
NSFileManager DefaultManager { get; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
[NullAllowed]
NSFileManagerDelegate Delegate { get; set; }
[Export ("setAttributes:ofItemAtPath:error:")]
bool SetAttributes (NSDictionary attributes, string path, out NSError error);
[Export ("createDirectoryAtPath:withIntermediateDirectories:attributes:error:")]
bool CreateDirectory (string path, bool createIntermediates, [NullAllowed] NSDictionary attributes, out NSError error);
[Export ("contentsOfDirectoryAtPath:error:")]
string[] GetDirectoryContent (string path, out NSError error);
[Export ("subpathsOfDirectoryAtPath:error:")]
string[] GetDirectoryContentRecursive (string path, out NSError error);
[Export ("attributesOfItemAtPath:error:")][Internal]
NSDictionary _GetAttributes (string path, out NSError error);
[Export ("attributesOfFileSystemForPath:error:")][Internal]
NSDictionary _GetFileSystemAttributes (String path, out NSError error);
[Export ("createSymbolicLinkAtPath:withDestinationPath:error:")]
bool CreateSymbolicLink (string path, string destPath, out NSError error);
[Export ("destinationOfSymbolicLinkAtPath:error:")]
string GetSymbolicLinkDestination (string path, out NSError error);
[Export ("copyItemAtPath:toPath:error:")]
bool Copy (string srcPath, string dstPath, out NSError error);
[Export ("moveItemAtPath:toPath:error:")]
bool Move (string srcPath, string dstPath, out NSError error);
[Export ("linkItemAtPath:toPath:error:")]
bool Link (string srcPath, string dstPath, out NSError error);
[Export ("removeItemAtPath:error:")]
bool Remove ([NullAllowed] string path, out NSError error);
#if DEPRECATED
// These are not available on iOS, and deprecated on OSX.
[Export ("linkPath:toPath:handler:")]
bool LinkPath (string src, string dest, IntPtr handler);
[Export ("copyPath:toPath:handler:")]
bool CopyPath (string src, string dest, IntPtr handler);
[Export ("movePath:toPath:handler:")]
bool MovePath (string src, string dest, IntPtr handler);
[Export ("removeFileAtPath:handler:")]
bool RemoveFileAtPath (string path, IntPtr handler);
#endif
[Export ("currentDirectoryPath")]
string GetCurrentDirectory ();
[Export ("changeCurrentDirectoryPath:")]
bool ChangeCurrentDirectory (string path);
[Export ("fileExistsAtPath:")]
bool FileExists (string path);
[Export ("fileExistsAtPath:isDirectory:")]
bool FileExists (string path, ref bool isDirectory);
[Export ("isReadableFileAtPath:")]
bool IsReadableFile (string path);
[Export ("isWritableFileAtPath:")]
bool IsWritableFile (string path);
[Export ("isExecutableFileAtPath:")]
bool IsExecutableFile (string path);
[Export ("isDeletableFileAtPath:")]
bool IsDeletableFile (string path);
[Export ("contentsEqualAtPath:andPath:")]
bool ContentsEqual (string path1, string path2);
[Export ("displayNameAtPath:")]
string DisplayName (string path);
[Export ("componentsToDisplayForPath:")]
string[] ComponentsToDisplay (string path);
[Export ("enumeratorAtPath:")]
NSDirectoryEnumerator GetEnumerator (string path);
[Export ("subpathsAtPath:")]
string[] Subpaths (string path);
[Export ("contentsAtPath:")]
NSData Contents (string path);
[Export ("createFileAtPath:contents:attributes:")]
bool CreateFile (string path, NSData data, [NullAllowed] NSDictionary attr);
[Export ("contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:")]
NSUrl[] GetDirectoryContent (NSUrl url, [NullAllowed] NSArray properties, NSDirectoryEnumerationOptions options, out NSError error);
[Export ("copyItemAtURL:toURL:error:")]
bool Copy (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
[Export ("moveItemAtURL:toURL:error:")]
bool Move (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
[Export ("linkItemAtURL:toURL:error:")]
bool Link (NSUrl srcUrl, NSUrl dstUrl, out NSError error);
[Export ("removeItemAtURL:error:")]
bool Remove ([NullAllowed] NSUrl url, out NSError error);
[Export ("enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:")]
NSDirectoryEnumerator GetEnumerator (NSUrl url, [NullAllowed] NSString[] keys, NSDirectoryEnumerationOptions options, [NullAllowed] NSEnumerateErrorHandler handler);
[Export ("URLForDirectory:inDomain:appropriateForURL:create:error:")]
NSUrl GetUrl (NSSearchPathDirectory directory, NSSearchPathDomain domain, [NullAllowed] NSUrl url, bool shouldCreate, out NSError error);
[Export ("URLsForDirectory:inDomains:")]
NSUrl[] GetUrls (NSSearchPathDirectory directory, NSSearchPathDomain domains);
[Export ("replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:")]
bool Replace (NSUrl originalItem, NSUrl newItem, [NullAllowed] string backupItemName, NSFileManagerItemReplacementOptions options, out NSUrl resultingURL, out NSError error);
[Export ("mountedVolumeURLsIncludingResourceValuesForKeys:options:")]
NSUrl[] GetMountedVolumes ([NullAllowed] NSArray properties, NSVolumeEnumerationOptions options);
// Methods to convert paths to/from C strings for passing to system calls - Not implemented
////- (const char *)fileSystemRepresentationWithPath:(NSString *)path;
//[Export ("fileSystemRepresentationWithPath:")]
//const char FileSystemRepresentationWithPath (string path);
////- (NSString *)stringWithFileSystemRepresentation:(const char *)str length:(NSUInteger)len;
//[Export ("stringWithFileSystemRepresentation:length:")]
//string StringWithFileSystemRepresentation (const char str, uint len);
[Export ("createDirectoryAtURL:withIntermediateDirectories:attributes:error:")]
bool CreateDirectory (NSUrl url, bool createIntermediates, [NullAllowed] NSDictionary attributes, out NSError error);
[Export ("createSymbolicLinkAtURL:withDestinationURL:error:")]
bool CreateSymbolicLink (NSUrl url, NSUrl destURL, out NSError error);
[Export ("setUbiquitous:itemAtURL:destinationURL:error:")]
bool SetUbiquitous (bool flag, NSUrl url, NSUrl destinationUrl, out NSError error);
[Export ("isUbiquitousItemAtURL:")]
bool IsUbiquitous (NSUrl url);
[Export ("startDownloadingUbiquitousItemAtURL:error:")]
bool StartDownloadingUbiquitous (NSUrl url, out NSError error);
[Export ("evictUbiquitousItemAtURL:error:")]
bool EvictUbiquitous (NSUrl url, out NSError error);
[Export ("URLForUbiquityContainerIdentifier:")]
NSUrl GetUrlForUbiquityContainer ([NullAllowed] string containerIdentifier);
[Export ("URLForPublishingUbiquitousItemAtURL:expirationDate:error:")]
NSUrl GetUrlForPublishingUbiquitousItem (NSUrl url, out NSDate expirationDate, out NSError error);
[Export ("ubiquityIdentityToken")]
NSObject UbiquityIdentityToken { get; }
[Field ("NSUbiquityIdentityDidChangeNotification")]
[Notification]
NSString UbiquityIdentityDidChangeNotification { get; }
[iOS (7,0)]
[Export ("containerURLForSecurityApplicationGroupIdentifier:")]
NSUrl GetContainerUrl (string securityApplicationGroupIdentifier);
[iOS (8,0), Mac (10,10)]
[Export ("getRelationship:ofDirectory:inDomain:toItemAtURL:error:")]
bool GetRelationship (out NSUrlRelationship outRelationship, NSSearchPathDirectory directory, NSSearchPathDomain domain, NSUrl toItemAtUrl, out NSError error);
[iOS (8,0), Mac (10,10)]
[Export ("getRelationship:ofDirectoryAtURL:toItemAtURL:error:")]
bool GetRelationship (out NSUrlRelationship outRelationship, NSUrl directoryURL, NSUrl otherURL, out NSError error);
[NoWatch][NoTV][NoiOS][Mac (10, 11)][NoMacCatalyst]
[Async]
[Export ("unmountVolumeAtURL:options:completionHandler:")]
void UnmountVolume (NSUrl url, NSFileManagerUnmountOptions mask, Action<NSError> completionHandler);
[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[Async, Export ("getFileProviderServicesForItemAtURL:completionHandler:")]
void GetFileProviderServices (NSUrl url, Action<NSDictionary<NSString, NSFileProviderService>, NSError> completionHandler);
}
[BaseType(typeof(NSObject))]
[Model]
[Protocol]
interface NSFileManagerDelegate {
[Export("fileManager:shouldCopyItemAtPath:toPath:")]
bool ShouldCopyItemAtPath(NSFileManager fm, NSString srcPath, NSString dstPath);
[NoMac]
[Export("fileManager:shouldCopyItemAtURL:toURL:")]
bool ShouldCopyItemAtUrl(NSFileManager fm, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldLinkItemAtURL:toURL:")]
bool ShouldLinkItemAtUrl (NSFileManager fileManager, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldMoveItemAtURL:toURL:")]
bool ShouldMoveItemAtUrl (NSFileManager fileManager, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:")]
bool ShouldProceedAfterErrorCopyingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:")]
bool ShouldProceedAfterErrorLinkingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldProceedAfterError:movingItemAtURL:toURL:")]
bool ShouldProceedAfterErrorMovingItem (NSFileManager fileManager, NSError error, NSUrl srcUrl, NSUrl dstUrl);
[NoMac]
[Export ("fileManager:shouldRemoveItemAtURL:")]
bool ShouldRemoveItemAtUrl (NSFileManager fileManager, NSUrl url);
[NoMac]
[Export ("fileManager:shouldProceedAfterError:removingItemAtURL:")]
bool ShouldProceedAfterErrorRemovingItem (NSFileManager fileManager, NSError error, NSUrl url);
[Export ("fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:")]
bool ShouldProceedAfterErrorCopyingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
[Export ("fileManager:shouldMoveItemAtPath:toPath:")]
bool ShouldMoveItemAtPath (NSFileManager fileManager, string srcPath, string dstPath);
[Export ("fileManager:shouldProceedAfterError:movingItemAtPath:toPath:")]
bool ShouldProceedAfterErrorMovingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
[Export ("fileManager:shouldLinkItemAtPath:toPath:")]
bool ShouldLinkItemAtPath (NSFileManager fileManager, string srcPath, string dstPath);
[Export ("fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:")]
bool ShouldProceedAfterErrorLinkingItem (NSFileManager fileManager, NSError error, string srcPath, string dstPath);
[Export ("fileManager:shouldRemoveItemAtPath:")]
bool ShouldRemoveItemAtPath (NSFileManager fileManager, string path);
[Export ("fileManager:shouldProceedAfterError:removingItemAtPath:")]
bool ShouldProceedAfterErrorRemovingItem (NSFileManager fileManager, NSError error, string path);
}
[Category]
[BaseType (typeof (NSFileManager))]
interface NSFileManager_NSUserInformation {
[NoWatch][NoTV][NoiOS][Mac (10, 12)]
[Export ("homeDirectoryForCurrentUser")]
NSUrl GetHomeDirectoryForCurrentUser ();
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[Export ("temporaryDirectory")]
NSUrl GetTemporaryDirectory ();
[NoWatch][NoTV][NoiOS][Mac (10, 12)]
[Export ("homeDirectoryForUser:")]
[return: NullAllowed]
NSUrl GetHomeDirectory (string userName);
}
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
partial interface NSFilePresenter {
[Abstract]
[Export ("presentedItemURL", ArgumentSemantic.Retain)]
#if NET
NSUrl PresentedItemUrl { get; }
#else
NSUrl PresentedItemURL { get; }
#endif
[Abstract]
[Export ("presentedItemOperationQueue", ArgumentSemantic.Retain)]
#if NET
NSOperationQueue PresentedItemOperationQueue { get; }
#else
NSOperationQueue PesentedItemOperationQueue { get; }
#endif
#if DOUBLE_BLOCKS
[Export ("relinquishPresentedItemToReader:")]
void RelinquishPresentedItemToReader (NSFilePresenterReacquirer readerAction);
[Export ("relinquishPresentedItemToWriter:")]
void RelinquishPresentedItemToWriter (NSFilePresenterReacquirer writerAction);
#endif
[Export ("savePresentedItemChangesWithCompletionHandler:")]
void SavePresentedItemChanges (Action<NSError> completionHandler);
[Export ("accommodatePresentedItemDeletionWithCompletionHandler:")]
void AccommodatePresentedItemDeletion (Action<NSError> completionHandler);
[Export ("presentedItemDidMoveToURL:")]
void PresentedItemMoved (NSUrl newURL);
[Export ("presentedItemDidChange")]
void PresentedItemChanged ();
[Export ("presentedItemDidGainVersion:")]
void PresentedItemGainedVersion (NSFileVersion version);
[Export ("presentedItemDidLoseVersion:")]
void PresentedItemLostVersion (NSFileVersion version);
[Export ("presentedItemDidResolveConflictVersion:")]
void PresentedItemResolveConflictVersion (NSFileVersion version);
[Export ("accommodatePresentedSubitemDeletionAtURL:completionHandler:")]
void AccommodatePresentedSubitemDeletion (NSUrl url, Action<NSError> completionHandler);
[Export ("presentedSubitemDidAppearAtURL:")]
void PresentedSubitemAppeared (NSUrl atUrl);
[Export ("presentedSubitemAtURL:didMoveToURL:")]
void PresentedSubitemMoved (NSUrl oldURL, NSUrl newURL);
[Export ("presentedSubitemDidChangeAtURL:")]
void PresentedSubitemChanged (NSUrl url);
[Export ("presentedSubitemAtURL:didGainVersion:")]
void PresentedSubitemGainedVersion (NSUrl url, NSFileVersion version);
[Export ("presentedSubitemAtURL:didLoseVersion:")]
void PresentedSubitemLostVersion (NSUrl url, NSFileVersion version);
[Export ("presentedSubitemAtURL:didResolveConflictVersion:")]
void PresentedSubitemResolvedConflictVersion (NSUrl url, NSFileVersion version);
[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[Export ("presentedItemDidChangeUbiquityAttributes:")]
void PresentedItemChangedUbiquityAttributes (NSSet<NSString> attributes);
[NoWatch, NoTV, Mac (10, 13), iOS (11, 0)]
[Export ("observedPresentedItemUbiquityAttributes", ArgumentSemantic.Strong)]
NSSet<NSString> PresentedItemObservedUbiquityAttributes { get; }
}
delegate void NSFileVersionNonlocalVersionsCompletionHandler ([NullAllowed] NSFileVersion[] nonlocalFileVersions, [NullAllowed] NSError error);
[BaseType (typeof (NSObject))]
// Objective-C exception thrown. Name: NSGenericException Reason: -[NSFileVersion init]: You have to use one of the factory methods to instantiate NSFileVersion.
[DisableDefaultCtor]
interface NSFileVersion {
[Export ("URL", ArgumentSemantic.Copy)]
NSUrl Url { get; }
[Export ("localizedName", ArgumentSemantic.Copy)]
string LocalizedName { get; }
[Export ("localizedNameOfSavingComputer", ArgumentSemantic.Copy)]
string LocalizedNameOfSavingComputer { get; }
[Export ("modificationDate", ArgumentSemantic.Copy)]
NSDate ModificationDate { get; }
[Export ("persistentIdentifier", ArgumentSemantic.Retain)]
NSObject PersistentIdentifier { get; }
[Export ("conflict")]
bool IsConflict { [Bind ("isConflict")] get; }
[Export ("resolved")]
bool Resolved { [Bind ("isResolved")] get; set; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("discardable")]
bool Discardable { [Bind ("isDiscardable")] get; set; }
[Mac (10,10)]
[iOS (8,0)]
[Export ("hasLocalContents")]
bool HasLocalContents { get; }
[Mac (10,10)]
[iOS (8,0)]
[Export ("hasThumbnail")]
bool HasThumbnail { get; }
[Static]
[Export ("currentVersionOfItemAtURL:")]
NSFileVersion GetCurrentVersion (NSUrl url);
[Mac (10,10)]
[iOS (8,0)]
[Static]
[Async]
[Export ("getNonlocalVersionsOfItemAtURL:completionHandler:")]
void GetNonlocalVersions (NSUrl url, NSFileVersionNonlocalVersionsCompletionHandler completionHandler);
[Static]
[Export ("otherVersionsOfItemAtURL:")]
NSFileVersion [] GetOtherVersions (NSUrl url);
[Static]
[Export ("unresolvedConflictVersionsOfItemAtURL:")]
NSFileVersion [] GetUnresolvedConflictVersions (NSUrl url);
[Static]
[Export ("versionOfItemAtURL:forPersistentIdentifier:")]
NSFileVersion GetSpecificVersion (NSUrl url, NSObject persistentIdentifier);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Static]
[Export ("addVersionOfItemAtURL:withContentsOfURL:options:error:")]
NSFileVersion AddVersion (NSUrl url, NSUrl contentsURL, NSFileVersionAddingOptions options, out NSError outError);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Static]
[Export ("temporaryDirectoryURLForNewVersionOfItemAtURL:")]
NSUrl TemporaryDirectoryForItem (NSUrl url);
[Export ("replaceItemAtURL:options:error:")]
NSUrl ReplaceItem (NSUrl url, NSFileVersionReplacingOptions options, out NSError error);
[Export ("removeAndReturnError:")]
bool Remove (out NSError outError);
[Static]
[Export ("removeOtherVersionsOfItemAtURL:error:")]
bool RemoveOtherVersions (NSUrl url, out NSError outError);
[NoWatch, NoTV, Mac (10, 12), iOS (10, 0)]
[NullAllowed, Export ("originatorNameComponents", ArgumentSemantic.Copy)]
NSPersonNameComponents OriginatorNameComponents { get; }
}
[BaseType (typeof (NSObject))]
interface NSFileWrapper : NSSecureCoding {
[DesignatedInitializer]
[Export ("initWithURL:options:error:")]
NativeHandle Constructor (NSUrl url, NSFileWrapperReadingOptions options, out NSError outError);
[DesignatedInitializer]
[Export ("initDirectoryWithFileWrappers:")]
NativeHandle Constructor (NSDictionary childrenByPreferredName);
[DesignatedInitializer]
[Export ("initRegularFileWithContents:")]
NativeHandle Constructor (NSData contents);
[DesignatedInitializer]
[Export ("initSymbolicLinkWithDestinationURL:")]
NativeHandle Constructor (NSUrl urlToSymbolicLink);
// Constructor clash
//[Export ("initWithSerializedRepresentation:")]
//NativeHandle Constructor (NSData serializeRepresentation);
[Export ("isDirectory")]
bool IsDirectory { get; }
[Export ("isRegularFile")]
bool IsRegularFile { get; }
[Export ("isSymbolicLink")]
bool IsSymbolicLink { get; }
[Export ("matchesContentsOfURL:")]
bool MatchesContentsOfURL (NSUrl url);
[Export ("readFromURL:options:error:")]
bool Read (NSUrl url, NSFileWrapperReadingOptions options, out NSError outError);
[Export ("writeToURL:options:originalContentsURL:error:")]
bool Write (NSUrl url, NSFileWrapperWritingOptions options, [NullAllowed] NSUrl originalContentsURL, out NSError outError);
[Export ("serializedRepresentation")]
NSData GetSerializedRepresentation ();
[Export ("addFileWrapper:")]
string AddFileWrapper (NSFileWrapper child);
[Export ("addRegularFileWithContents:preferredFilename:")]
string AddRegularFile (NSData dataContents, string preferredFilename);
[Export ("removeFileWrapper:")]
void RemoveFileWrapper (NSFileWrapper child);
[Export ("fileWrappers")]
NSDictionary FileWrappers { get; }
[Export ("keyForFileWrapper:")]
string KeyForFileWrapper (NSFileWrapper child);
[Export ("regularFileContents")]
NSData GetRegularFileContents ();
[Export ("symbolicLinkDestinationURL")]
NSUrl SymbolicLinkDestinationURL { get; }
//Detected properties
// [NullAllowed] can't be used. It's null by default but, on device, it throws-n-crash
// NSInvalidArgumentException -[NSFileWrapper setPreferredFilename:] *** preferredFilename cannot be empty.
[Export ("preferredFilename")]
string PreferredFilename { get; set; }
[NullAllowed] // by default this property is null
[Export ("filename")]
string Filename { get; set; }
[Export ("fileAttributes", ArgumentSemantic.Copy)]
NSDictionary FileAttributes { get; set; }
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("icon", ArgumentSemantic.Retain)]
NSImage Icon { get; set; }
}
[BaseType (typeof (NSEnumerator))]
interface NSDirectoryEnumerator {
[Export ("fileAttributes")]
NSDictionary FileAttributes { get; }
[Export ("directoryAttributes")]
NSDictionary DirectoryAttributes { get; }
[Export ("skipDescendents")]
void SkipDescendents ();
[NoMac]
[Export ("level")]
nint Level { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("isEnumeratingDirectoryPostOrder")]
bool IsEnumeratingDirectoryPostOrder { get; }
}
delegate bool NSPredicateEvaluator (NSObject evaluatedObject, NSDictionary bindings);
[BaseType (typeof (NSObject))]
// 'init' returns NIL
[DisableDefaultCtor]
interface NSPredicate : NSSecureCoding, NSCopying {
[Static]
[Internal]
[Export ("predicateWithFormat:argumentArray:")]
NSPredicate _FromFormat (string predicateFormat, [NullAllowed] NSObject[] arguments);
[Static, Export ("predicateWithValue:")]
NSPredicate FromValue (bool value);
[Static, Export ("predicateWithBlock:")]
NSPredicate FromExpression (NSPredicateEvaluator evaluator);
[Export ("predicateFormat")]
string PredicateFormat { get; }
[Export ("predicateWithSubstitutionVariables:")]
NSPredicate PredicateWithSubstitutionVariables (NSDictionary substitutionVariables);
[Export ("evaluateWithObject:")]
bool EvaluateWithObject (NSObject obj);
[Export ("evaluateWithObject:substitutionVariables:")]
bool EvaluateWithObject (NSObject obj, NSDictionary substitutionVariables);
[Static]
[Mac (10, 9)]
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("predicateFromMetadataQueryString:")]
NSPredicate FromMetadataQueryString (string query);
[iOS (7,0), Mac (10, 9)]
[Export ("allowEvaluation")]
void AllowEvaluation ();
}
[Category, BaseType (typeof (NSOrderedSet))]
partial interface NSPredicateSupport_NSOrderedSet {
[Export ("filteredOrderedSetUsingPredicate:")]
NSOrderedSet FilterUsingPredicate (NSPredicate p);
}
[Category, BaseType (typeof (NSMutableOrderedSet))]
partial interface NSPredicateSupport_NSMutableOrderedSet {
[Export ("filterUsingPredicate:")]
void FilterUsingPredicate (NSPredicate p);
}
[Category, BaseType (typeof (NSArray))]
partial interface NSPredicateSupport_NSArray {
[Export ("filteredArrayUsingPredicate:")]
NSArray FilterUsingPredicate (NSArray array);
}
#pragma warning disable 618
[Category, BaseType (typeof (NSMutableArray))]
#pragma warning restore 618
partial interface NSPredicateSupport_NSMutableArray {
[Export ("filterUsingPredicate:")]
void FilterUsingPredicate (NSPredicate predicate);
}
[Category, BaseType (typeof (NSSet))]
partial interface NSPredicateSupport_NSSet {
[Export ("filteredSetUsingPredicate:")]
NSSet FilterUsingPredicate (NSPredicate predicate);
}
[Category, BaseType (typeof (NSMutableSet))]
partial interface NSPredicateSupport_NSMutableSet {
[Export ("filterUsingPredicate:")]
void FilterUsingPredicate (NSPredicate predicate);
}
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[BaseType (typeof (NSObject), Name="NSURLDownload")]
interface NSUrlDownload {
[Static, Export ("canResumeDownloadDecodedWithEncodingMIMEType:")]
bool CanResumeDownloadDecodedWithEncodingMimeType (string mimeType);
[Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSURLSession' instead.")]
[Export ("initWithRequest:delegate:")]
NativeHandle Constructor (NSUrlRequest request, NSObject delegate1);
[Deprecated (PlatformName.MacOSX, 10, 11, message: "Use 'NSURLSession' instead.")]
[Export ("initWithResumeData:delegate:path:")]
NativeHandle Constructor (NSData resumeData, NSObject delegate1, string path);
[Export ("cancel")]
void Cancel ();
[Export ("setDestination:allowOverwrite:")]
void SetDestination (string path, bool allowOverwrite);
[Export ("request")]
NSUrlRequest Request { get; }
[Export ("resumeData")]
NSData ResumeData { get; }
[Export ("deletesFileUponFailure")]
bool DeletesFileUponFailure { get; set; }
}
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[BaseType (typeof (NSObject))]
[Model]
[Protocol (Name = "NSURLDownloadDelegate")]
interface NSUrlDownloadDelegate {
[Export ("downloadDidBegin:")]
void DownloadBegan (NSUrlDownload download);
[Export ("download:willSendRequest:redirectResponse:")]
NSUrlRequest WillSendRequest (NSUrlDownload download, NSUrlRequest request, NSUrlResponse redirectResponse);
[Export ("download:didReceiveAuthenticationChallenge:")]
void ReceivedAuthenticationChallenge (NSUrlDownload download, NSUrlAuthenticationChallenge challenge);
[Export ("download:didCancelAuthenticationChallenge:")]
void CanceledAuthenticationChallenge (NSUrlDownload download, NSUrlAuthenticationChallenge challenge);
[Export ("download:didReceiveResponse:")]
void ReceivedResponse (NSUrlDownload download, NSUrlResponse response);
//- (void)download:(NSUrlDownload *)download willResumeWithResponse:(NSUrlResponse *)response fromByte:(long long)startingByte;
[Export ("download:willResumeWithResponse:fromByte:")]
void Resume (NSUrlDownload download, NSUrlResponse response, long startingByte);
//- (void)download:(NSUrlDownload *)download didReceiveDataOfLength:(NSUInteger)length;
[Export ("download:didReceiveDataOfLength:")]
void ReceivedData (NSUrlDownload download, nuint length);
[Export ("download:shouldDecodeSourceDataOfMIMEType:")]
bool DecodeSourceData (NSUrlDownload download, string encodingType);
[Export ("download:decideDestinationWithSuggestedFilename:")]
void DecideDestination (NSUrlDownload download, string suggestedFilename);
[Export ("download:didCreateDestination:")]
void CreatedDestination (NSUrlDownload download, string path);
[Export ("downloadDidFinish:")]
void Finished (NSUrlDownload download);
[Export ("download:didFailWithError:")]
void FailedWithError(NSUrlDownload download, NSError error);
}
// Users are not supposed to implement the NSUrlProtocolClient protocol, they're
// only supposed to consume it. This is why there's no model for this protocol.
[Protocol (Name = "NSURLProtocolClient")]
interface NSUrlProtocolClient {
[Abstract]
[Export ("URLProtocol:wasRedirectedToRequest:redirectResponse:")]
void Redirected (NSUrlProtocol protocol, NSUrlRequest redirectedToEequest, NSUrlResponse redirectResponse);
[Abstract]
[Export ("URLProtocol:cachedResponseIsValid:")]
void CachedResponseIsValid (NSUrlProtocol protocol, NSCachedUrlResponse cachedResponse);
[Abstract]
[Export ("URLProtocol:didReceiveResponse:cacheStoragePolicy:")]
void ReceivedResponse (NSUrlProtocol protocol, NSUrlResponse response, NSUrlCacheStoragePolicy policy);
[Abstract]
[Export ("URLProtocol:didLoadData:")]
void DataLoaded (NSUrlProtocol protocol, NSData data);
[Abstract]
[Export ("URLProtocolDidFinishLoading:")]
void FinishedLoading (NSUrlProtocol protocol);
[Abstract]
[Export ("URLProtocol:didFailWithError:")]
void FailedWithError (NSUrlProtocol protocol, NSError error);
[Abstract]
[Export ("URLProtocol:didReceiveAuthenticationChallenge:")]
void ReceivedAuthenticationChallenge (NSUrlProtocol protocol, NSUrlAuthenticationChallenge challenge);
[Abstract]
[Export ("URLProtocol:didCancelAuthenticationChallenge:")]
void CancelledAuthenticationChallenge (NSUrlProtocol protocol, NSUrlAuthenticationChallenge challenge);
}
interface INSUrlProtocolClient {}
[BaseType (typeof (NSObject),
Name="NSURLProtocol",
Delegates=new string [] {"WeakClient"})]
interface NSUrlProtocol {
[DesignatedInitializer]
[Export ("initWithRequest:cachedResponse:client:")]
NativeHandle Constructor (NSUrlRequest request, [NullAllowed] NSCachedUrlResponse cachedResponse, INSUrlProtocolClient client);
[Export ("client")]
INSUrlProtocolClient Client { get; }
[Export ("request")]
NSUrlRequest Request { get; }
[Export ("cachedResponse")]
NSCachedUrlResponse CachedResponse { get; }
[Static]
[Export ("canInitWithRequest:")]
bool CanInitWithRequest (NSUrlRequest request);
[Static]
[Export ("canonicalRequestForRequest:")]
NSUrlRequest GetCanonicalRequest (NSUrlRequest forRequest);
[Static]
[Export ("requestIsCacheEquivalent:toRequest:")]
bool IsRequestCacheEquivalent (NSUrlRequest first, NSUrlRequest second);
[Export ("startLoading")]
void StartLoading ();
[Export ("stopLoading")]
void StopLoading ();
[Static]
[Export ("propertyForKey:inRequest:")]
NSObject GetProperty (string key, NSUrlRequest inRequest);
[Static]
[Export ("setProperty:forKey:inRequest:")]
void SetProperty ([NullAllowed] NSObject value, string key, NSMutableUrlRequest inRequest);
[Static]
[Export ("removePropertyForKey:inRequest:")]
void RemoveProperty (string propertyKey, NSMutableUrlRequest request);
[Static]
[Export ("registerClass:")]
bool RegisterClass (Class protocolClass);
[Static]
[Export ("unregisterClass:")]
void UnregisterClass (Class protocolClass);
// Commented API are broken and we'll need to provide a workaround for them
// https://trello.com/c/RthKXnyu/381-disabled-nsurlprotocol-api-reminder
// * "task" does not answer and is not usable - maybe it only works if created from the new API ?!?
//
// * "canInitWithTask" can't be called as a .NET static method. The ObjC code uses the current type
// internally (which will always be NSURLProtocol in .NET never a subclass) and complains about it
// being abstract (which is true)
// -canInitWithRequest: cannot be sent to an abstract object of class NSURLProtocol: Create a concrete instance!
// [iOS (8,0)]
// [Export ("initWithTask:cachedResponse:client:")]
// NativeHandle Constructor (NSUrlSessionTask task, [NullAllowed] NSCachedUrlResponse cachedResponse, INSUrlProtocolClient client);
//
// [iOS (8,0)]
// [Export ("task", ArgumentSemantic.Copy)]
// NSUrlSessionTask Task { get; }
//
// [iOS (8,0)]
// [Static, Export ("canInitWithTask:")]
// bool CanInitWithTask (NSUrlSessionTask task);
}
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface NSPropertyListSerialization {
[Static, Export ("dataWithPropertyList:format:options:error:")]
NSData DataWithPropertyList (NSObject plist, NSPropertyListFormat format,
NSPropertyListWriteOptions options, out NSError error);
[Static, Export ("writePropertyList:toStream:format:options:error:")]
nint WritePropertyList (NSObject plist, NSOutputStream stream, NSPropertyListFormat format,
NSPropertyListWriteOptions options, out NSError error);
[Static, Export ("propertyListWithData:options:format:error:")]
NSObject PropertyListWithData (NSData data, NSPropertyListReadOptions options,
ref NSPropertyListFormat format, out NSError error);
[Static, Export ("propertyListWithStream:options:format:error:")]
NSObject PropertyListWithStream (NSInputStream stream, NSPropertyListReadOptions options,
ref NSPropertyListFormat format, out NSError error);
[Static, Export ("propertyList:isValidForFormat:")]
bool IsValidForFormat (NSObject plist, NSPropertyListFormat format);
}
interface INSExtensionRequestHandling { }
[iOS (8,0)][Mac (10,10)] // Not defined in 32-bit
[Protocol, Model]
[BaseType (typeof (NSObject))]
interface NSExtensionRequestHandling {
[Abstract]
// @required - (void)beginRequestWithExtensionContext:(NSExtensionContext *)context;
[Export ("beginRequestWithExtensionContext:")]
void BeginRequestWithExtensionContext (NSExtensionContext context);
}
[Protocol]
interface NSLocking {
[Abstract]
[Export ("lock")]
void Lock ();
[Abstract]
[Export ("unlock")]
void Unlock ();
}
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // An uncaught exception was raised: *** -range cannot be sent to an abstract object of class NSTextCheckingResult: Create a concrete instance!
interface NSTextCheckingResult : NSSecureCoding, NSCopying {
[Export ("resultType")]
NSTextCheckingType ResultType { get; }
[Export ("range")]
NSRange Range { get; }
// From the NSTextCheckingResultOptional category on NSTextCheckingResult
[Export ("orthography")]
NSOrthography Orthography { get; }
[Export ("grammarDetails")]
string[] GrammarDetails { get; }
[Export ("date")]
NSDate Date { get; }
[Export ("timeZone")]
NSTimeZone TimeZone { get; }
[Export ("duration")]
double TimeInterval { get; }
[Export ("components")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
NSDictionary WeakComponents { get; }
[Wrap ("WeakComponents")]
NSTextCheckingTransitComponents Components { get; }
[Export ("URL")]
NSUrl Url { get; }
[Export ("replacementString")]
string ReplacementString { get; }
[Export ("alternativeStrings")]
[iOS (7, 0)]
[Mac (10, 9)]
string [] AlternativeStrings { get; }
// NSRegularExpression isn't bound
// [Export ("regularExpression")]
// NSRegularExpression RegularExpression { get; }
[Export ("phoneNumber")]
string PhoneNumber { get; }
[Export ("addressComponents")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
NSDictionary WeakAddressComponents { get; }
[Wrap ("WeakAddressComponents")]
NSTextCheckingAddressComponents AddressComponents { get; }
[Export ("numberOfRanges")]
nuint NumberOfRanges { get; }
[Export ("rangeAtIndex:")]
NSRange RangeAtIndex (nuint idx);
[Export ("resultByAdjustingRangesWithOffset:")]
NSTextCheckingResult ResultByAdjustingRanges (nint offset);
// From the NSTextCheckingResultCreation category on NSTextCheckingResult
[Static]
[Export ("orthographyCheckingResultWithRange:orthography:")]
NSTextCheckingResult OrthographyCheckingResult (NSRange range, NSOrthography ortography);
[Static]
[Export ("spellCheckingResultWithRange:")]
NSTextCheckingResult SpellCheckingResult (NSRange range);
[Static]
[Export ("grammarCheckingResultWithRange:details:")]
NSTextCheckingResult GrammarCheckingResult (NSRange range, string[] details);
[Static]
[Export ("dateCheckingResultWithRange:date:")]
NSTextCheckingResult DateCheckingResult (NSRange range, NSDate date);
[Static]
[Export ("dateCheckingResultWithRange:date:timeZone:duration:")]
NSTextCheckingResult DateCheckingResult (NSRange range, NSDate date, NSTimeZone timezone, double duration);
[Static]
[Export ("addressCheckingResultWithRange:components:")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
NSTextCheckingResult AddressCheckingResult (NSRange range, NSDictionary components);
[Static]
[Wrap ("AddressCheckingResult (range, components.GetDictionary ()!)")]
NSTextCheckingResult AddressCheckingResult (NSRange range, NSTextCheckingAddressComponents components);
[Static]
[Export ("linkCheckingResultWithRange:URL:")]
NSTextCheckingResult LinkCheckingResult (NSRange range, NSUrl url);
[Static]
[Export ("quoteCheckingResultWithRange:replacementString:")]
NSTextCheckingResult QuoteCheckingResult (NSRange range, NSString replacementString);
[Static]
[Export ("dashCheckingResultWithRange:replacementString:")]
NSTextCheckingResult DashCheckingResult (NSRange range, string replacementString);
[Static]
[Export ("replacementCheckingResultWithRange:replacementString:")]
NSTextCheckingResult ReplacementCheckingResult (NSRange range, string replacementString);
[Static]
[Export ("correctionCheckingResultWithRange:replacementString:")]
NSTextCheckingResult CorrectionCheckingResult (NSRange range, string replacementString);
[Static]
[Export ("correctionCheckingResultWithRange:replacementString:alternativeStrings:")]
[iOS (7, 0)]
[Mac (10, 9)]
NSTextCheckingResult CorrectionCheckingResult (NSRange range, string replacementString, string[] alternativeStrings);
// NSRegularExpression isn't bound
// [Export ("regularExpressionCheckingResultWithRanges:count:regularExpression:")]
// [Internal] // FIXME
// NSTextCheckingResult RegularExpressionCheckingResult (ref NSRange ranges, nuint count, NSRegularExpression regularExpression);
[Static]
[Export ("phoneNumberCheckingResultWithRange:phoneNumber:")]
NSTextCheckingResult PhoneNumberCheckingResult (NSRange range, string phoneNumber);
[Static]
[Export ("transitInformationCheckingResultWithRange:components:")]
[EditorBrowsable (EditorBrowsableState.Advanced)]
NSTextCheckingResult TransitInformationCheckingResult (NSRange range, NSDictionary components);
[Static]
[Wrap ("TransitInformationCheckingResult (range, components.GetDictionary ()!)")]
NSTextCheckingResult TransitInformationCheckingResult (NSRange range, NSTextCheckingTransitComponents components);
[Watch (4,0), TV (11,0), Mac (10,13), iOS (11,0)]
[Export ("rangeWithName:")]
NSRange GetRange (string name);
}
[StrongDictionary ("NSTextChecking")]
interface NSTextCheckingTransitComponents {
string Airline { get; }
string Flight { get; }
}
[StrongDictionary ("NSTextChecking")]
interface NSTextCheckingAddressComponents {
string Name { get; }
string JobTitle { get; }
string Organization { get; }
string Street { get; }
string City { get; }
string State { get; }
[Export ("ZipKey")]
string ZIP { get; }
string Country { get; }
string Phone { get; }
}
[Static]
interface NSTextChecking {
[Field ("NSTextCheckingNameKey")]
NSString NameKey { get; }
[Field ("NSTextCheckingJobTitleKey")]
NSString JobTitleKey { get; }
[Field ("NSTextCheckingOrganizationKey")]
NSString OrganizationKey { get; }
[Field ("NSTextCheckingStreetKey")]
NSString StreetKey { get; }
[Field ("NSTextCheckingCityKey")]
NSString CityKey { get; }
[Field ("NSTextCheckingStateKey")]
NSString StateKey { get; }
[Field ("NSTextCheckingZIPKey")]
NSString ZipKey { get; }
[Field ("NSTextCheckingCountryKey")]
NSString CountryKey { get; }
[Field ("NSTextCheckingPhoneKey")]
NSString PhoneKey { get; }
[Field ("NSTextCheckingAirlineKey")]
NSString AirlineKey { get; }
[Field ("NSTextCheckingFlightKey")]
NSString FlightKey { get; }
}
[BaseType (typeof(NSObject))]
interface NSLock : NSLocking
{
[Export ("tryLock")]
bool TryLock ();
[Export ("lockBeforeDate:")]
bool LockBeforeDate (NSDate limit);
[Export ("name")]
[NullAllowed]
string Name { get; set; }
}
[BaseType (typeof(NSObject))]
interface NSConditionLock : NSLocking {
[DesignatedInitializer]
[Export ("initWithCondition:")]
NativeHandle Constructor (nint condition);
[Export ("condition")]
nint Condition { get; }
[Export ("lockWhenCondition:")]
void LockWhenCondition (nint condition);
[Export ("tryLock")]
bool TryLock ();
[Export ("tryLockWhenCondition:")]
bool TryLockWhenCondition (nint condition);
[Export ("unlockWithCondition:")]
void UnlockWithCondition (nint condition);
[Export ("lockBeforeDate:")]
bool LockBeforeDate (NSDate limit);
[Export ("lockWhenCondition:beforeDate:")]
bool LockWhenCondition (nint condition, NSDate limit);
[Export ("name")]
[NullAllowed]
string Name { get; set; }
}
[BaseType (typeof(NSObject))]
interface NSRecursiveLock : NSLocking
{
[Export ("tryLock")]
bool TryLock ();
[Export ("lockBeforeDate:")]
bool LockBeforeDate (NSDate limit);
[Export ("name")]
[NullAllowed]
string Name { get; set; }
}
[BaseType (typeof(NSObject))]
interface NSCondition : NSLocking
{
[Export ("wait")]
void Wait ();
[Export ("waitUntilDate:")]
bool WaitUntilDate (NSDate limit);
[Export ("signal")]
void Signal ();
[Export ("broadcast")]
void Broadcast ();
[Export ("name")]
[NullAllowed]
string Name { get; set; }
}
// Not yet, the IntPtr[] argument isn't handled correctly by the generator (it tries to convert to NSArray, while the native method expects a C array).
// [Protocol]
// interface NSFastEnumeration {
// [Abstract]
// [Export ("countByEnumeratingWithState:objects:count:")]
// nuint Enumerate (ref NSFastEnumerationState state, IntPtr[] objects, nuint count);
// }
// Placeholer, just so we can start flagging things
interface INSFastEnumeration {}
partial interface NSBundle {
// - (NSImage *)imageForResource:(NSString *)name NS_AVAILABLE_MAC(10_7);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("imageForResource:")]
NSImage ImageForResource (string name);
}
partial interface NSAttributedString {
#if MONOMAC
[Field ("NSTextLayoutSectionOrientation", "AppKit")]
#else
[Field ("NSTextLayoutSectionOrientation", "UIKit")]
#endif
[iOS (7,0)]
NSString TextLayoutSectionOrientation { get; }
#if MONOMAC
[Field ("NSTextLayoutSectionRange", "AppKit")]
#else
[Field ("NSTextLayoutSectionRange", "UIKit")]
#endif
[iOS (7,0)]
NSString TextLayoutSectionRange { get; }
#if MONOMAC
[Field ("NSTextLayoutSectionsAttribute", "AppKit")]
#else
[Field ("NSTextLayoutSectionsAttribute", "UIKit")]
#endif
[iOS (7,0)]
NSString TextLayoutSectionsAttribute { get; }
[NoiOS, NoWatch, NoTV]
[Deprecated (PlatformName.MacOSX, 10, 11)]
[Field ("NSUnderlineByWordMask", "AppKit")]
nint UnderlineByWordMaskAttributeName { get; }
#if MONOMAC
[Field ("NSTextScalingDocumentAttribute", "AppKit")]
#else
[Field ("NSTextScalingDocumentAttribute", "UIKit")]
#endif
[Mac (10,15)]
[iOS (13,0), TV (13,0), Watch (6,0)]
NSString TextScalingDocumentAttribute { get; }
#if MONOMAC
[Field ("NSSourceTextScalingDocumentAttribute", "AppKit")]
#else
[Field ("NSSourceTextScalingDocumentAttribute", "UIKit")]
#endif
[Mac (10,15)]
[iOS (13,0), TV (13,0), Watch (6,0)]
NSString SourceTextScalingDocumentAttribute { get; }
#if MONOMAC
[Field ("NSCocoaVersionDocumentAttribute", "AppKit")]
#else
[Field ("NSCocoaVersionDocumentAttribute", "UIKit")]
#endif
[Mac (10,15)]
[iOS (13,0), TV (13,0), Watch (6,0)]
NSString CocoaVersionDocumentAttribute { get; }
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSObject))]
interface NSDateInterval : NSCopying, NSSecureCoding {
[Export ("startDate", ArgumentSemantic.Copy)]
NSDate StartDate { get; }
[Export ("endDate", ArgumentSemantic.Copy)]
NSDate EndDate { get; }
[Export ("duration")]
double Duration { get; }
[Export ("initWithStartDate:duration:")]
[DesignatedInitializer]
NativeHandle Constructor (NSDate startDate, double duration);
[Export ("initWithStartDate:endDate:")]
NativeHandle Constructor (NSDate startDate, NSDate endDate);
[Export ("compare:")]
NSComparisonResult Compare (NSDateInterval dateInterval);
[Export ("isEqualToDateInterval:")]
bool IsEqualTo (NSDateInterval dateInterval);
[Export ("intersectsDateInterval:")]
bool Intersects (NSDateInterval dateInterval);
[Export ("intersectionWithDateInterval:")]
[return: NullAllowed]
NSDateInterval GetIntersection (NSDateInterval dateInterval);
[Export ("containsDate:")]
bool ContainsDate (NSDate date);
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSObject))]
interface NSUnit : NSCopying, NSSecureCoding {
[Export ("symbol")]
string Symbol { get; }
[Export ("initWithSymbol:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol);
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSObject))]
interface NSUnitConverter {
[Export ("baseUnitValueFromValue:")]
double GetBaseUnitValue (double value);
[Export ("valueFromBaseUnitValue:")]
double GetValue (double baseUnitValue);
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSUnitConverter))]
interface NSUnitConverterLinear : NSSecureCoding {
[Export ("coefficient")]
double Coefficient { get; }
[Export ("constant")]
double Constant { get; }
[Export ("initWithCoefficient:")]
NativeHandle Constructor (double coefficient);
[Export ("initWithCoefficient:constant:")]
[DesignatedInitializer]
NativeHandle Constructor (double coefficient, double constant);
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSUnit))]
[Abstract] // abstract subclass of NSUnit
[DisableDefaultCtor] // there's a designated initializer
interface NSDimension : NSSecureCoding {
// Inlined from base type
[Export ("initWithSymbol:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol);
[Export ("converter", ArgumentSemantic.Copy)]
NSUnitConverter Converter { get; }
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
// needs to be overriden in suubclasses
// NSInvalidArgumentException Reason: *** You must override baseUnit in your class NSDimension to define its base unit.
// we provide a basic, managed, implementation that throws with a similar message
//[Static]
//[Export ("baseUnit")]
//NSDimension BaseUnit { get; }
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
[DisableDefaultCtor] // base type has a designated initializer
interface NSUnitTemperature : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("kelvin", ArgumentSemantic.Copy)]
NSUnitTemperature Kelvin { get; }
[Static]
[Export ("celsius", ArgumentSemantic.Copy)]
NSUnitTemperature Celsius { get; }
[Static]
[Export ("fahrenheit", ArgumentSemantic.Copy)]
NSUnitTemperature Fahrenheit { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
partial interface NSFileManager {
[iOS (11, 0), NoTV, NoWatch]
[Export ("trashItemAtURL:resultingItemURL:error:")]
bool TrashItem (NSUrl url, out NSUrl resultingItemUrl, out NSError error);
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Mac (10,14)]
[Static]
[Export ("fileManagerWithAuthorization:")]
NSFileManager FromAuthorization (NSWorkspaceAuthorization authorization);
}
[NoWatch, NoTV, Mac (10,13), iOS (11,0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface NSFileProviderService
{
[Export ("name")]
string Name { get; }
}
#if MONOMAC
partial interface NSFilePresenter {
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("primaryPresentedItemURL")]
NSUrl PrimaryPresentedItemUrl { get; }
}
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
partial interface NSAttributedString {
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[Export ("boundingRectWithSize:options:")]
CGRect BoundingRectWithSize (CGSize size, NSStringDrawingOptions options);
}
[NoiOS][NoMacCatalyst][NoWatch][NoTV]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
partial interface NSHost {
[Static, Internal, Export ("currentHost")]
NSHost _Current { get;}
[Static, Internal, Export ("hostWithName:")]
NSHost _FromName (string name);
[Static, Internal, Export ("hostWithAddress:")]
NSHost _FromAddress (string address);
[Export ("isEqualToHost:")]
bool Equals ([NullAllowed] NSHost host);
[Export ("name")]
string Name { get; }
[Export ("localizedName")]
string LocalizedName { get; }
[Export ("names")]
string [] Names { get; }
[Internal, Export ("address")]
string _Address { get; }
[Internal, Export ("addresses")]
string [] _Addresses { get; }
[Export ("hash"), Internal]
nuint _Hash { get; }
/* Deprecated, here for completeness:
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_7)]
[Static, Export ("setHostCacheEnabled:")]
void SetHostCacheEnabled (bool flag);
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_7)]
[Static, Export ("isHostCacheEnabled")]
bool IsHostCacheEnabled ();
[Availability (Introduced = Platform.Mac_10_0, Deprecated = Platform.Mac_10_7)]
[Static, Export ("flushHostCache")]
void FlushHostCache ();
*/
}
#endif
[DisableDefaultCtor]
[BaseType (typeof (NSObject))]
[MacCatalyst(15,0)]
[NoiOS][NoTV][NoWatch]
partial interface NSScriptCommand : NSCoding {
[Internal]
[DesignatedInitializer]
[Export ("initWithCommandDescription:")]
NativeHandle Constructor (NSScriptCommandDescription cmdDescription);
[Internal]
[Static]
[Export ("currentCommand")]
IntPtr GetCurrentCommand ();
[Export ("appleEvent")]
NSAppleEventDescriptor AppleEvent { get; }
[Export ("executeCommand")]
IntPtr Execute ();
[Export ("evaluatedReceivers")]
NSObject EvaluatedReceivers { get; }
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15,0)]
[StrongDictionary ("NSScriptCommandArgumentDescriptionKeys")]
partial interface NSScriptCommandArgumentDescription {
string AppleEventCode { get; set; }
string Type { get; set;}
string Optional { get; set; }
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15,0)]
[StrongDictionary ("NSScriptCommandDescriptionDictionaryKeys")]
partial interface NSScriptCommandDescriptionDictionary {
string CommandClass { get; set; }
string AppleEventCode { get; set; }
string AppleEventClassCode { get; set; }
string Type { get; set;}
string ResultAppleEventCode { get; set; }
NSMutableDictionary Arguments { get; set; }
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15,0)]
[DisableDefaultCtor]
[BaseType (typeof (NSObject))]
partial interface NSScriptCommandDescription : NSCoding {
[Internal]
[DesignatedInitializer]
[Export ("initWithSuiteName:commandName:dictionary:")]
NativeHandle Constructor (NSString suiteName, NSString commandName, NSDictionary commandDeclaration);
[Internal]
[Export ("appleEventClassCode")]
int FCCAppleEventClassCode { get; }
[Internal]
[Export ("appleEventCode")]
int FCCAppleEventCode { get; }
[Export ("commandClassName")]
string ClassName { get; }
[Export ("commandName")]
string Name { get; }
[Export ("suiteName")]
string SuitName { get; }
[Internal]
[Export ("appleEventCodeForArgumentWithName:")]
int FCCAppleEventCodeForArgument (NSString name);
[Export ("argumentNames")]
string [] ArgumentNames { get; }
[Internal]
[Export ("isOptionalArgumentWithName:")]
bool NSIsOptionalArgument (NSString name);
[Internal]
[Export ("typeForArgumentWithName:")]
NSString GetNSTypeForArgument (NSString name);
[Internal]
[Export ("appleEventCodeForReturnType")]
int FCCAppleEventCodeForReturnType { get; }
[Export ("returnType")]
string ReturnType { get; }
[Internal]
[Export ("createCommandInstance")]
IntPtr CreateCommandInstancePtr ();
}
[NoiOS, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
[MacCatalyst (13, 0)]
interface NSAffineTransform : NSSecureCoding, NSCopying {
[Export ("initWithTransform:")]
NativeHandle Constructor (NSAffineTransform transform);
[Export ("translateXBy:yBy:")]
void Translate (nfloat deltaX, nfloat deltaY);
[Export ("rotateByDegrees:")]
void RotateByDegrees (nfloat angle);
[Export ("rotateByRadians:")]
void RotateByRadians (nfloat angle);
[Export ("scaleBy:")]
void Scale (nfloat scale);
[Export ("scaleXBy:yBy:")]
void Scale (nfloat scaleX, nfloat scaleY);
[Export ("invert")]
void Invert ();
[Export ("appendTransform:")]
void AppendTransform (NSAffineTransform transform);
[Export ("prependTransform:")]
void PrependTransform (NSAffineTransform transform);
[Export ("transformPoint:")]
CGPoint TransformPoint (CGPoint aPoint);
[Export ("transformSize:")]
CGSize TransformSize (CGSize aSize);
[NoMacCatalyst]
[Export ("transformBezierPath:")]
NSBezierPath TransformBezierPath (NSBezierPath path);
[Export ("set")]
void Set ();
[Export ("concat")]
void Concat ();
[Export ("transformStruct")]
CGAffineTransform TransformStruct { get; set; }
}
[Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'NSXpcConnection' instead.")]
[NoMacCatalyst]
[NoiOS, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSConnection {
[Static, Export ("connectionWithReceivePort:sendPort:")]
NSConnection Create ([NullAllowed] NSPort receivePort, [NullAllowed] NSPort sendPort);
[Export ("runInNewThread")]
void RunInNewThread ();
// enableMultipleThreads, multipleThreadsEnabled - no-op in 10.5+ (always enabled)
[Export ("addRunLoop:")]
void AddRunLoop (NSRunLoop runLoop);
[Export ("removeRunLoop:")]
void RemoveRunLoop (NSRunLoop runLoop);
[Static, Export ("serviceConnectionWithName:rootObject:usingNameServer:")]
NSConnection CreateService (string name, NSObject root, NSPortNameServer server);
[Static, Export ("serviceConnectionWithName:rootObject:")]
NSConnection CreateService (string name, NSObject root);
[Export ("registerName:")]
bool RegisterName (string name);
[Export ("registerName:withNameServer:")]
bool RegisterName (string name, NSPortNameServer server);
[Export ("rootObject", ArgumentSemantic.Retain)]
NSObject RootObject { get; set; }
[Static, Export ("connectionWithRegisteredName:host:")]
NSConnection LookupService (string name, [NullAllowed] string hostName);
[Static, Export ("connectionWithRegisteredName:host:usingNameServer:")]
NSConnection LookupService (string name, [NullAllowed] string hostName, NSPortNameServer server);
[Internal, Export ("rootProxy")]
IntPtr _GetRootProxy ();
[Internal, Static, Export ("rootProxyForConnectionWithRegisteredName:host:")]
IntPtr _GetRootProxy (string name, [NullAllowed] string hostName);
[Internal, Static, Export ("rootProxyForConnectionWithRegisteredName:host:usingNameServer:")]
IntPtr _GetRootProxy (string name, [NullAllowed] string hostName, NSPortNameServer server);
[Export ("remoteObjects")]
NSObject [] RemoteObjects { get; }
[Export ("localObjects")]
NSObject [] LocalObjects { get; }
[Static, Export ("currentConversation")]
NSObject CurrentConversation { get; }
[Static, Export ("allConnections")]
NSConnection [] AllConnections { get; }
[Export ("requestTimeout")]
NSTimeInterval RequestTimeout { get; set; }
[Export ("replyTimeout")]
NSTimeInterval ReplyTimeout { get; set; }
[Export ("independentConversationQueueing")]
bool IndependentConversationQueueing { get; set; }
[Export ("addRequestMode:")]
void AddRequestMode (NSString runLoopMode);
[Export ("removeRequestMode:")]
void RemoveRequestMode (NSString runLoopMode);
[Export ("requestModes")]
NSString [] RequestModes { get; }
[Export ("invalidate")]
void Invalidate ();
[Export ("isValid")]
bool IsValid { get; }
[Export ("receivePort")]
NSPort ReceivePort { get; }
[Export ("sendPort")]
NSPort SendPort { get; }
[Export ("dispatchWithComponents:")]
void Dispatch (NSArray components);
[Export ("statistics")]
NSDictionary Statistics { get; }
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
NSConnectionDelegate Delegate { get; set; }
}
[Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'NSXpcConnection' instead.")]
[NoMacCatalyst]
[NoiOS, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface NSConnectionDelegate {
[Export ("authenticateComponents:withData:")]
bool AuthenticateComponents (NSArray components, NSData authenticationData);
[Export ("authenticationDataForComponents:")]
NSData GetAuthenticationData (NSArray components);
[Export ("connection:shouldMakeNewConnection:")]
bool ShouldMakeNewConnection (NSConnection parentConnection, NSConnection newConnection);
[Export ("connection:handleRequest:")]
bool HandleRequest (NSConnection connection, NSDistantObjectRequest request);
[Export ("createConversationForConnection:")]
NSObject CreateConversation (NSConnection connection);
[Export ("makeNewConnection:sender:")]
bool AllowNewConnection (NSConnection newConnection, NSConnection parentConnection);
}
[Deprecated (PlatformName.MacOSX, 10, 13, message : "Use 'NSXpcConnection' instead.")]
[NoMacCatalyst]
[NoiOS, NoTV, NoWatch]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSDistantObjectRequest {
[Export ("connection")]
NSConnection Connection { get; }
[Export ("conversation")]
NSObject Conversation { get; }
[Export ("invocation")]
NSInvocation Invocation { get; }
[Export ("replyWithException:")]
void Reply ([NullAllowed] NSException exception);
}
[NoMacCatalyst]
[NoiOS, NoTV, NoWatch]
[Deprecated (PlatformName.MacOSX, 10, 13)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSPortNameServer {
[Static, Export ("systemDefaultPortNameServer")]
NSPortNameServer SystemDefault { get; }
[Export ("portForName:")]
NSPort GetPort (string portName);
[Export ("portForName:host:")]
NSPort GetPort (string portName, string hostName);
[Export ("registerPort:name:")]
bool RegisterPort (NSPort port, string portName);
[Export ("removePortForName:")]
bool RemovePort (string portName);
}
[NoiOS, NoTV, NoWatch]
[MacCatalyst (15, 0)]
[BaseType (typeof (NSObject))]
interface NSAppleEventDescriptor : NSSecureCoding, NSCopying {
[Static]
[Export ("nullDescriptor")]
NSAppleEventDescriptor NullDescriptor { get; }
/* [Static]
[Export ("descriptorWithDescriptorType:bytes:length:")]
NSAppleEventDescriptor DescriptorWithDescriptorTypebyteslength (DescType descriptorType, void bytes, uint byteCount);
[Static]
[Export ("descriptorWithDescriptorType:data:")]
NSAppleEventDescriptor DescriptorWithDescriptorTypedata (DescType descriptorType, NSData data);*/
[Static]
[Export ("descriptorWithBoolean:")]
NSAppleEventDescriptor DescriptorWithBoolean (Boolean boolean);
[Static]
[Export ("descriptorWithEnumCode:")]
NSAppleEventDescriptor DescriptorWithEnumCode (OSType enumerator);
[Static]
[Export ("descriptorWithInt32:")]
NSAppleEventDescriptor DescriptorWithInt32 (int /* int32 */ signedInt);
[Static]
[Export ("descriptorWithTypeCode:")]
NSAppleEventDescriptor DescriptorWithTypeCode (OSType typeCode);
[Static]
[Export ("descriptorWithString:")]
NSAppleEventDescriptor DescriptorWithString (string str);
/*[Static]
[Export ("appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:")]
NSAppleEventDescriptor AppleEventWithEventClasseventIDtargetDescriptorreturnIDtransactionID (AEEventClass eventClass, AEEventID eventID, NSAppleEventDescriptor targetDescriptor, AEReturnID returnID, AETransactionID transactionID);*/
[Static]
[Export ("listDescriptor")]
NSAppleEventDescriptor ListDescriptor { get; }
[Static]
[Export ("recordDescriptor")]
NSAppleEventDescriptor RecordDescriptor { get; }
/*[Export ("initWithAEDescNoCopy:")]
NSObject InitWithAEDescNoCopy (const AEDesc aeDesc);
[Export ("initWithDescriptorType:bytes:length:")]
NSObject InitWithDescriptorTypebyteslength (DescType descriptorType, void bytes, uint byteCount);
[Export ("initWithDescriptorType:data:")]
NSObject InitWithDescriptorTypedata (DescType descriptorType, NSData data);
[Export ("initWithEventClass:eventID:targetDescriptor:returnID:transactionID:")]
NSObject InitWithEventClasseventIDtargetDescriptorreturnIDtransactionID (AEEventClass eventClass, AEEventID eventID, NSAppleEventDescriptor targetDescriptor, AEReturnID returnID, AETransactionID transactionID);*/
[Internal]
[Sealed]
[Export ("initListDescriptor")]
IntPtr _InitListDescriptor ();
[Internal]
[Sealed]
[Export ("initRecordDescriptor")]
IntPtr _InitRecordDescriptor ();
#if !XAMCORE_3_0
[Obsolete ("Use the constructor instead.")]
[Export ("initListDescriptor")]
NSObject InitListDescriptor ();
[Obsolete ("Use the constructor instead.")]
[Export ("initRecordDescriptor")]
NSObject InitRecordDescriptor ();
#endif
/*[Export ("aeDesc")]
const AEDesc AeDesc ();
[Export ("descriptorType")]
DescType DescriptorType ();*/
[Export ("data")]
NSData Data { get; }
[Export ("booleanValue")]
Boolean BooleanValue { get; }
[Export ("enumCodeValue")]
OSType EnumCodeValue ();
[Export ("int32Value")]
Int32 Int32Value { get; }
[Export ("typeCodeValue")]
OSType TypeCodeValue { get; }
[NullAllowed]
[Export ("stringValue")]
string StringValue { get; }
[Export ("eventClass")]
AEEventClass EventClass { get; }
[Export ("eventID")]
AEEventID EventID { get; }
/*[Export ("returnID")]
AEReturnID ReturnID ();
[Export ("transactionID")]
AETransactionID TransactionID ();*/
[Export ("setParamDescriptor:forKeyword:")]
void SetParamDescriptorforKeyword (NSAppleEventDescriptor descriptor, AEKeyword keyword);
[return: NullAllowed]
[Export ("paramDescriptorForKeyword:")]
NSAppleEventDescriptor ParamDescriptorForKeyword (AEKeyword keyword);
[Export ("removeParamDescriptorWithKeyword:")]
void RemoveParamDescriptorWithKeyword (AEKeyword keyword);
[Export ("setAttributeDescriptor:forKeyword:")]
void SetAttributeDescriptorforKeyword (NSAppleEventDescriptor descriptor, AEKeyword keyword);
[return: NullAllowed]
[Export ("attributeDescriptorForKeyword:")]
NSAppleEventDescriptor AttributeDescriptorForKeyword (AEKeyword keyword);
[Export ("numberOfItems")]
nint NumberOfItems { get; }
[Export ("insertDescriptor:atIndex:")]
void InsertDescriptoratIndex (NSAppleEventDescriptor descriptor, nint index);
[return: NullAllowed]
[Export ("descriptorAtIndex:")]
NSAppleEventDescriptor DescriptorAtIndex (nint index);
[Export ("removeDescriptorAtIndex:")]
void RemoveDescriptorAtIndex (nint index);
[Export ("setDescriptor:forKeyword:")]
void SetDescriptorforKeyword (NSAppleEventDescriptor descriptor, AEKeyword keyword);
[return: NullAllowed]
[Export ("descriptorForKeyword:")]
NSAppleEventDescriptor DescriptorForKeyword (AEKeyword keyword);
[Export ("removeDescriptorWithKeyword:")]
void RemoveDescriptorWithKeyword (AEKeyword keyword);
[Export ("keywordForDescriptorAtIndex:")]
AEKeyword KeywordForDescriptorAtIndex (nint index);
/*[Export ("coerceToDescriptorType:")]
NSAppleEventDescriptor CoerceToDescriptorType (DescType descriptorType);*/
[Mac (10, 11)]
[Static]
[Export ("currentProcessDescriptor")]
NSAppleEventDescriptor CurrentProcessDescriptor { get; }
[Mac (10,11)]
[Static]
[Export ("descriptorWithDouble:")]
NSAppleEventDescriptor FromDouble (double doubleValue);
[Mac (10,11)]
[Static]
[Export ("descriptorWithDate:")]
NSAppleEventDescriptor FromDate (NSDate date);
[Mac (10,11)]
[Static]
[Export ("descriptorWithFileURL:")]
NSAppleEventDescriptor FromFileURL (NSUrl fileURL);
[Mac (10,11)]
[Static]
[Export ("descriptorWithProcessIdentifier:")]
NSAppleEventDescriptor FromProcessIdentifier (int processIdentifier);
[Mac (10,11)]
[Static]
[Export ("descriptorWithBundleIdentifier:")]
NSAppleEventDescriptor FromBundleIdentifier (string bundleIdentifier);
[Mac (10,11)]
[Static]
[Export ("descriptorWithApplicationURL:")]
NSAppleEventDescriptor FromApplicationURL (NSUrl applicationURL);
[Mac (10, 11)]
[Export ("doubleValue")]
double DoubleValue { get; }
[Mac (10,11)]
[NoMacCatalyst]
[Export ("sendEventWithOptions:timeout:error:")]
[return: NullAllowed]
NSAppleEventDescriptor SendEvent (NSAppleEventSendOptions sendOptions, double timeoutInSeconds, [NullAllowed] out NSError error);
[Mac (10, 11)]
[Export ("isRecordDescriptor")]
bool IsRecordDescriptor { get; }
[Mac (10, 11)]
[NullAllowed, Export ("dateValue", ArgumentSemantic.Copy)]
NSDate DateValue { get; }
[Mac (10, 11)]
[NullAllowed, Export ("fileURLValue", ArgumentSemantic.Copy)]
NSUrl FileURLValue { get; }
}
[NoiOS, NoTV, NoWatch]
[MacCatalyst (15, 0)]
[BaseType (typeof (NSObject))]
interface NSAppleEventManager {
[Static]
[Export ("sharedAppleEventManager")]
NSAppleEventManager SharedAppleEventManager { get; }
[Export ("setEventHandler:andSelector:forEventClass:andEventID:")]
void SetEventHandler (NSObject handler, Selector handleEventSelector, AEEventClass eventClass, AEEventID eventID);
[Export ("removeEventHandlerForEventClass:andEventID:")]
void RemoveEventHandler (AEEventClass eventClass, AEEventID eventID);
[NullAllowed]
[Export ("currentAppleEvent")]
NSAppleEventDescriptor CurrentAppleEvent { get; }
[NullAllowed]
[Export ("currentReplyAppleEvent")]
NSAppleEventDescriptor CurrentReplyAppleEvent { get; }
[Export ("suspendCurrentAppleEvent")]
NSAppleEventManagerSuspensionID SuspendCurrentAppleEvent ();
[Export ("appleEventForSuspensionID:")]
NSAppleEventDescriptor AppleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID);
[Export ("replyAppleEventForSuspensionID:")]
NSAppleEventDescriptor ReplyAppleEventForSuspensionID (NSAppleEventManagerSuspensionID suspensionID);
[Export ("setCurrentAppleEventAndReplyEventWithSuspensionID:")]
void SetCurrentAppleEventAndReplyEventWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID);
[Export ("resumeWithSuspensionID:")]
void ResumeWithSuspensionID (NSAppleEventManagerSuspensionID suspensionID);
}
[NoiOS, NoTV, NoWatch]
[MacCatalyst (15, 0)]
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
interface NSTask {
[NoMacCatalyst]
[Deprecated (PlatformName.MacOSX, 10,15)]
[Export ("launch")]
void Launch ();
[Export ("interrupt")]
void Interrupt ();
[Export ("terminate")]
void Terminate ();
[Export ("suspend")]
bool Suspend ();
[Export ("resume")]
bool Resume ();
[Export ("waitUntilExit")]
void WaitUntilExit ();
[Static]
[Deprecated (PlatformName.MacOSX, 10,15)]
[Export ("launchedTaskWithLaunchPath:arguments:")]
NSTask LaunchFromPath (string path, string[] arguments);
//Detected properties
[NullAllowed]
[Deprecated (PlatformName.MacOSX, 10,15)]
[NoMacCatalyst]
[Export ("launchPath")]
string LaunchPath { get; set; }
[NullAllowed]
[Export ("arguments")]
string [] Arguments { get; set; }
[NullAllowed]
[Export ("environment", ArgumentSemantic.Copy)]
NSDictionary Environment { get; set; }
[NoMacCatalyst]
[Deprecated (PlatformName.MacOSX, 10,15)]
[Export ("currentDirectoryPath")]
string CurrentDirectoryPath { get; set; }
[NullAllowed]
[Export ("standardInput", ArgumentSemantic.Retain)]
NSObject StandardInput { get; set; }
[NullAllowed]
[Export ("standardOutput", ArgumentSemantic.Retain)]
NSObject StandardOutput { get; set; }
[NullAllowed]
[Export ("standardError", ArgumentSemantic.Retain)]
NSObject StandardError { get; set; }
[Export ("isRunning")]
bool IsRunning { get; }
[Export ("processIdentifier")]
int ProcessIdentifier { get; } /* pid_t = int */
[Export ("terminationStatus")]
int TerminationStatus { get; } /* int, not NSInteger */
[NoMacCatalyst]
[Export ("terminationReason")]
NSTaskTerminationReason TerminationReason { get; }
#if !NET && MONOMAC
[Field ("NSTaskDidTerminateNotification")]
NSString NSTaskDidTerminateNotification { get; }
#endif
[Field ("NSTaskDidTerminateNotification")]
[Notification]
NSString DidTerminateNotification { get; }
}
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[BaseType (typeof (NSObject))]
[DesignatedDefaultCtor]
[Advice ("'NSUserNotification' usages should be replaced with 'UserNotifications' framework.")]
interface NSUserNotification : NSCoding, NSCopying {
[Export ("title", ArgumentSemantic.Copy)]
string Title { get; set; }
[Export ("subtitle", ArgumentSemantic.Copy)]
string Subtitle { get; set; }
[Export ("informativeText", ArgumentSemantic.Copy)]
string InformativeText { get; set; }
[Export ("actionButtonTitle", ArgumentSemantic.Copy)]
string ActionButtonTitle { get; set; }
[Export ("userInfo", ArgumentSemantic.Copy)]
NSDictionary UserInfo { get; set; }
[Export ("deliveryDate", ArgumentSemantic.Copy)]
NSDate DeliveryDate { get; set; }
[Export ("deliveryTimeZone", ArgumentSemantic.Copy)]
NSTimeZone DeliveryTimeZone { get; set; }
[Export ("deliveryRepeatInterval", ArgumentSemantic.Copy)]
NSDateComponents DeliveryRepeatInterval { get; set; }
[Export ("actualDeliveryDate")]
NSDate ActualDeliveryDate { get; }
[Export ("presented")]
bool Presented { [Bind("isPresented")] get; }
[Export ("remote")]
bool Remote { [Bind("isRemote")] get; }
[Export ("soundName", ArgumentSemantic.Copy)]
string SoundName { get; set; }
[Export ("hasActionButton")]
bool HasActionButton { get; set; }
[Export ("activationType")]
NSUserNotificationActivationType ActivationType { get; }
[Export ("otherButtonTitle", ArgumentSemantic.Copy)]
string OtherButtonTitle { get; set; }
[Field ("NSUserNotificationDefaultSoundName")]
NSString NSUserNotificationDefaultSoundName { get; }
[Mac (10, 9)]
[NullAllowed, Export ("identifier")]
string Identifier { get; set; }
[Mac (10, 9)]
[NullAllowed, Export ("contentImage", ArgumentSemantic.Copy)]
NSImage ContentImage { get; set; }
[Mac (10, 9)]
[Export ("hasReplyButton")]
bool HasReplyButton { get; set; }
[Mac (10, 9)]
[NullAllowed, Export ("responsePlaceholder")]
string ResponsePlaceholder { get; set; }
[Mac (10, 9)]
[NullAllowed, Export ("response", ArgumentSemantic.Copy)]
NSAttributedString Response { get; }
[Mac (10, 10)]
[NullAllowed, Export ("additionalActions", ArgumentSemantic.Copy)]
NSUserNotificationAction[] AdditionalActions { get; set; }
[Mac (10, 10)]
[NullAllowed, Export ("additionalActivationAction", ArgumentSemantic.Copy)]
NSUserNotificationAction AdditionalActivationAction { get; }
}
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[Mac (10,10)]
[BaseType (typeof(NSObject))]
[Advice ("'NSUserNotification' usages should be replaced with 'UserNotifications' framework.")]
interface NSUserNotificationAction : NSCopying
{
[Static]
[Export ("actionWithIdentifier:title:")]
NSUserNotificationAction GetAction ([NullAllowed] string identifier, [NullAllowed] string title);
[NullAllowed, Export ("identifier")]
string Identifier { get; }
[NullAllowed, Export ("title")]
string Title { get; }
}
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[BaseType (typeof (NSObject),
Delegates=new string [] {"WeakDelegate"},
Events=new Type [] { typeof (NSUserNotificationCenterDelegate) })]
[DisableDefaultCtor] // crash with: NSUserNotificationCenter designitated initializer is _centerForBundleIdentifier
[Advice ("'NSUserNotification' usages should be replaced with 'UserNotifications' framework.")]
interface NSUserNotificationCenter
{
[Export ("defaultUserNotificationCenter")][Static]
NSUserNotificationCenter DefaultUserNotificationCenter { get; }
[Export ("delegate", ArgumentSemantic.Assign)][NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")][NullAllowed]
[Protocolize]
NSUserNotificationCenterDelegate Delegate { get; set; }
[Export ("scheduledNotifications", ArgumentSemantic.Copy)]
NSUserNotification [] ScheduledNotifications { get; set; }
[Export ("scheduleNotification:")][PostGet ("ScheduledNotifications")]
void ScheduleNotification (NSUserNotification notification);
[Export ("removeScheduledNotification:")][PostGet ("ScheduledNotifications")]
void RemoveScheduledNotification (NSUserNotification notification);
[Export ("deliveredNotifications")]
NSUserNotification [] DeliveredNotifications { get; }
[Export ("deliverNotification:")][PostGet ("DeliveredNotifications")]
void DeliverNotification (NSUserNotification notification);
[Export ("removeDeliveredNotification:")][PostGet ("DeliveredNotifications")]
void RemoveDeliveredNotification (NSUserNotification notification);
[Export ("removeAllDeliveredNotifications")][PostGet ("DeliveredNotifications")]
void RemoveAllDeliveredNotifications ();
}
[NoiOS, NoTV, NoWatch, NoMacCatalyst]
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
[Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'UserNotifications.*' API instead.")]
interface NSUserNotificationCenterDelegate
{
[Export ("userNotificationCenter:didDeliverNotification:"), EventArgs ("UNCDidDeliverNotification")]
void DidDeliverNotification (NSUserNotificationCenter center, NSUserNotification notification);
[Export ("userNotificationCenter:didActivateNotification:"), EventArgs ("UNCDidActivateNotification")]
void DidActivateNotification (NSUserNotificationCenter center, NSUserNotification notification);
[Export ("userNotificationCenter:shouldPresentNotification:"), DelegateName ("UNCShouldPresentNotification"), DefaultValue (false)]
bool ShouldPresentNotification (NSUserNotificationCenter center, NSUserNotification notification);
}
[NoiOS, NoTV, NoWatch]
[MacCatalyst (13, 0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSAppleScript : NSCopying {
// @required - (instancetype)initWithContentsOfURL:(NSURL *)url error:(NSDictionary **)errorInfo;
[DesignatedInitializer]
[Export ("initWithContentsOfURL:error:")]
NativeHandle Constructor (NSUrl url, out NSDictionary errorInfo);
// @required - (instancetype)initWithSource:(NSString *)source;
[DesignatedInitializer]
[Export ("initWithSource:")]
NativeHandle Constructor (string source);
// @property (readonly, copy) NSString * source;
[NullAllowed]
[Export ("source")]
string Source { get; }
// @property (readonly, getter = isCompiled) BOOL compiled;
[Export ("compiled")]
bool Compiled { [Bind ("isCompiled")] get; }
// @required - (BOOL)compileAndReturnError:(NSDictionary **)errorInfo;
[Export ("compileAndReturnError:")]
bool CompileAndReturnError (out NSDictionary errorInfo);
// @required - (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary **)errorInfo;
[Export ("executeAndReturnError:")]
NSAppleEventDescriptor ExecuteAndReturnError (out NSDictionary errorInfo);
// @required - (NSAppleEventDescriptor *)executeAppleEvent:(NSAppleEventDescriptor *)event error:(NSDictionary **)errorInfo;
[Export ("executeAppleEvent:error:")]
NSAppleEventDescriptor ExecuteAppleEvent (NSAppleEventDescriptor eventDescriptor, out NSDictionary errorInfo);
[NullAllowed]
[Export ("richTextSource", ArgumentSemantic.Retain)]
NSAttributedString RichTextSource { get; }
}
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
[BaseType (typeof (NSFormatter), Name = "NSISO8601DateFormatter")]
[DesignatedDefaultCtor]
interface NSIso8601DateFormatter : NSSecureCoding {
[Export ("timeZone", ArgumentSemantic.Copy)]
NSTimeZone TimeZone { get; set; }
[Export ("formatOptions", ArgumentSemantic.Assign)]
NSIso8601DateFormatOptions FormatOptions { get; set; }
[Export ("stringFromDate:")]
string ToString (NSDate date);
[Export ("dateFromString:")]
[return: NullAllowed]
NSDate ToDate (string @string);
[Static]
[Export ("stringFromDate:timeZone:formatOptions:")]
string Format (NSDate date, NSTimeZone timeZone, NSIso8601DateFormatOptions formatOptions);
}
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
[BaseType (typeof (NSObject), Name = "NSURLSessionTaskTransactionMetrics")]
[DisableDefaultCtor]
interface NSUrlSessionTaskTransactionMetrics {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "This type is not meant to be user created.")]
[Export ("init")]
NativeHandle Constructor ();
[Export ("request", ArgumentSemantic.Copy)]
NSUrlRequest Request { get; }
[NullAllowed, Export ("response", ArgumentSemantic.Copy)]
NSUrlResponse Response { get; }
[NullAllowed, Export ("fetchStartDate", ArgumentSemantic.Copy)]
NSDate FetchStartDate { get; }
[NullAllowed, Export ("domainLookupStartDate", ArgumentSemantic.Copy)]
NSDate DomainLookupStartDate { get; }
[NullAllowed, Export ("domainLookupEndDate", ArgumentSemantic.Copy)]
NSDate DomainLookupEndDate { get; }
[NullAllowed, Export ("connectStartDate", ArgumentSemantic.Copy)]
NSDate ConnectStartDate { get; }
[NullAllowed, Export ("secureConnectionStartDate", ArgumentSemantic.Copy)]
NSDate SecureConnectionStartDate { get; }
[NullAllowed, Export ("secureConnectionEndDate", ArgumentSemantic.Copy)]
NSDate SecureConnectionEndDate { get; }
[NullAllowed, Export ("connectEndDate", ArgumentSemantic.Copy)]
NSDate ConnectEndDate { get; }
[NullAllowed, Export ("requestStartDate", ArgumentSemantic.Copy)]
NSDate RequestStartDate { get; }
[NullAllowed, Export ("requestEndDate", ArgumentSemantic.Copy)]
NSDate RequestEndDate { get; }
[NullAllowed, Export ("responseStartDate", ArgumentSemantic.Copy)]
NSDate ResponseStartDate { get; }
[NullAllowed, Export ("responseEndDate", ArgumentSemantic.Copy)]
NSDate ResponseEndDate { get; }
[NullAllowed, Export ("networkProtocolName")]
string NetworkProtocolName { get; }
[Export ("proxyConnection")]
bool ProxyConnection { [Bind ("isProxyConnection")] get; }
[Export ("reusedConnection")]
bool ReusedConnection { [Bind ("isReusedConnection")] get; }
[Export ("resourceFetchType", ArgumentSemantic.Assign)]
NSUrlSessionTaskMetricsResourceFetchType ResourceFetchType { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfRequestHeaderBytesSent")]
long CountOfRequestHeaderBytesSent { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfRequestBodyBytesSent")]
long CountOfRequestBodyBytesSent { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfRequestBodyBytesBeforeEncoding")]
long CountOfRequestBodyBytesBeforeEncoding { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfResponseHeaderBytesReceived")]
long CountOfResponseHeaderBytesReceived { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfResponseBodyBytesReceived")]
long CountOfResponseBodyBytesReceived { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("countOfResponseBodyBytesAfterDecoding")]
long CountOfResponseBodyBytesAfterDecoding { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("localAddress")]
string LocalAddress { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("localPort", ArgumentSemantic.Copy)]
// 0-1023
[BindAs (typeof (ushort?))]
NSNumber LocalPort { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("remoteAddress")]
string RemoteAddress { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("remotePort", ArgumentSemantic.Copy)]
// 0-1023
[BindAs (typeof (ushort?))]
NSNumber RemotePort { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("negotiatedTLSProtocolVersion", ArgumentSemantic.Copy)]
// <quote>It is a 2-byte sequence in host byte order.</quote> but it refers to (nicer) `tls_protocol_version_t`
[BindAs (typeof (SslProtocol?))]
NSNumber NegotiatedTlsProtocolVersion { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[NullAllowed, Export ("negotiatedTLSCipherSuite", ArgumentSemantic.Copy)]
// <quote>It is a 2-byte sequence in host byte order.</quote> but it refers to (nicer) `tls_ciphersuite_t`
#if NET
[BindAs (typeof (TlsCipherSuite?))]
#else
[BindAs (typeof (SslCipherSuite?))]
#endif
NSNumber NegotiatedTlsCipherSuite { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("cellular")]
bool Cellular { [Bind ("isCellular")] get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("expensive")]
bool Expensive { [Bind ("isExpensive")] get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("constrained")]
bool Constrained { [Bind ("isConstrained")] get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Export ("multipath")]
bool Multipath { [Bind ("isMultipath")] get; }
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Export ("domainResolutionProtocol")]
NSUrlSessionTaskMetricsDomainResolutionProtocol DomainResolutionProtocol { get; }
}
[iOS (10,0)][TV (10,0)][Watch (3,0)][Mac (10,12)]
[BaseType (typeof (NSObject), Name = "NSURLSessionTaskMetrics")]
[DisableDefaultCtor]
interface NSUrlSessionTaskMetrics {
[Deprecated (PlatformName.MacOSX, 10, 15, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "This type is not meant to be user created.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "This type is not meant to be user created.")]
[Export ("init")]
NativeHandle Constructor ();
[Export ("transactionMetrics", ArgumentSemantic.Copy)]
NSUrlSessionTaskTransactionMetrics[] TransactionMetrics { get; }
[Export ("taskInterval", ArgumentSemantic.Copy)]
NSDateInterval TaskInterval { get; }
[Export ("redirectCount")]
nuint RedirectCount { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitAcceleration : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("metersPerSecondSquared", ArgumentSemantic.Copy)]
NSUnitAcceleration MetersPerSecondSquared { get; }
[Static]
[Export ("gravity", ArgumentSemantic.Copy)]
NSUnitAcceleration Gravity { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitAngle : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("degrees", ArgumentSemantic.Copy)]
NSUnitAngle Degrees { get; }
[Static]
[Export ("arcMinutes", ArgumentSemantic.Copy)]
NSUnitAngle ArcMinutes { get; }
[Static]
[Export ("arcSeconds", ArgumentSemantic.Copy)]
NSUnitAngle ArcSeconds { get; }
[Static]
[Export ("radians", ArgumentSemantic.Copy)]
NSUnitAngle Radians { get; }
[Static]
[Export ("gradians", ArgumentSemantic.Copy)]
NSUnitAngle Gradians { get; }
[Static]
[Export ("revolutions", ArgumentSemantic.Copy)]
NSUnitAngle Revolutions { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitArea : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("squareMegameters", ArgumentSemantic.Copy)]
NSUnitArea SquareMegameters { get; }
[Static]
[Export ("squareKilometers", ArgumentSemantic.Copy)]
NSUnitArea SquareKilometers { get; }
[Static]
[Export ("squareMeters", ArgumentSemantic.Copy)]
NSUnitArea SquareMeters { get; }
[Static]
[Export ("squareCentimeters", ArgumentSemantic.Copy)]
NSUnitArea SquareCentimeters { get; }
[Static]
[Export ("squareMillimeters", ArgumentSemantic.Copy)]
NSUnitArea SquareMillimeters { get; }
[Static]
[Export ("squareMicrometers", ArgumentSemantic.Copy)]
NSUnitArea SquareMicrometers { get; }
[Static]
[Export ("squareNanometers", ArgumentSemantic.Copy)]
NSUnitArea SquareNanometers { get; }
[Static]
[Export ("squareInches", ArgumentSemantic.Copy)]
NSUnitArea SquareInches { get; }
[Static]
[Export ("squareFeet", ArgumentSemantic.Copy)]
NSUnitArea SquareFeet { get; }
[Static]
[Export ("squareYards", ArgumentSemantic.Copy)]
NSUnitArea SquareYards { get; }
[Static]
[Export ("squareMiles", ArgumentSemantic.Copy)]
NSUnitArea SquareMiles { get; }
[Static]
[Export ("acres", ArgumentSemantic.Copy)]
NSUnitArea Acres { get; }
[Static]
[Export ("ares", ArgumentSemantic.Copy)]
NSUnitArea Ares { get; }
[Static]
[Export ("hectares", ArgumentSemantic.Copy)]
NSUnitArea Hectares { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitConcentrationMass : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("gramsPerLiter", ArgumentSemantic.Copy)]
NSUnitConcentrationMass GramsPerLiter { get; }
[Static]
[Export ("milligramsPerDeciliter", ArgumentSemantic.Copy)]
NSUnitConcentrationMass MilligramsPerDeciliter { get; }
[Static]
[Export ("millimolesPerLiterWithGramsPerMole:")]
NSUnitConcentrationMass GetMillimolesPerLiter (double gramsPerMole);
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitDispersion : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("partsPerMillion", ArgumentSemantic.Copy)]
NSUnitDispersion PartsPerMillion { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitDuration : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("seconds", ArgumentSemantic.Copy)]
NSUnitDuration Seconds { get; }
[Static]
[Export ("minutes", ArgumentSemantic.Copy)]
NSUnitDuration Minutes { get; }
[Static]
[Export ("hours", ArgumentSemantic.Copy)]
NSUnitDuration Hours { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Static]
[Export ("milliseconds", ArgumentSemantic.Copy)]
NSUnitDuration Milliseconds { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Static]
[Export ("microseconds", ArgumentSemantic.Copy)]
NSUnitDuration Microseconds { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Static]
[Export ("nanoseconds", ArgumentSemantic.Copy)]
NSUnitDuration Nanoseconds { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Static]
[Export ("picoseconds", ArgumentSemantic.Copy)]
NSUnitDuration Picoseconds { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitElectricCharge : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("coulombs", ArgumentSemantic.Copy)]
NSUnitElectricCharge Coulombs { get; }
[Static]
[Export ("megaampereHours", ArgumentSemantic.Copy)]
NSUnitElectricCharge MegaampereHours { get; }
[Static]
[Export ("kiloampereHours", ArgumentSemantic.Copy)]
NSUnitElectricCharge KiloampereHours { get; }
[Static]
[Export ("ampereHours", ArgumentSemantic.Copy)]
NSUnitElectricCharge AmpereHours { get; }
[Static]
[Export ("milliampereHours", ArgumentSemantic.Copy)]
NSUnitElectricCharge MilliampereHours { get; }
[Static]
[Export ("microampereHours", ArgumentSemantic.Copy)]
NSUnitElectricCharge MicroampereHours { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitElectricCurrent : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("megaamperes", ArgumentSemantic.Copy)]
NSUnitElectricCurrent Megaamperes { get; }
[Static]
[Export ("kiloamperes", ArgumentSemantic.Copy)]
NSUnitElectricCurrent Kiloamperes { get; }
[Static]
[Export ("amperes", ArgumentSemantic.Copy)]
NSUnitElectricCurrent Amperes { get; }
[Static]
[Export ("milliamperes", ArgumentSemantic.Copy)]
NSUnitElectricCurrent Milliamperes { get; }
[Static]
[Export ("microamperes", ArgumentSemantic.Copy)]
NSUnitElectricCurrent Microamperes { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitElectricPotentialDifference : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("megavolts", ArgumentSemantic.Copy)]
NSUnitElectricPotentialDifference Megavolts { get; }
[Static]
[Export ("kilovolts", ArgumentSemantic.Copy)]
NSUnitElectricPotentialDifference Kilovolts { get; }
[Static]
[Export ("volts", ArgumentSemantic.Copy)]
NSUnitElectricPotentialDifference Volts { get; }
[Static]
[Export ("millivolts", ArgumentSemantic.Copy)]
NSUnitElectricPotentialDifference Millivolts { get; }
[Static]
[Export ("microvolts", ArgumentSemantic.Copy)]
NSUnitElectricPotentialDifference Microvolts { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitElectricResistance : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("megaohms", ArgumentSemantic.Copy)]
NSUnitElectricResistance Megaohms { get; }
[Static]
[Export ("kiloohms", ArgumentSemantic.Copy)]
NSUnitElectricResistance Kiloohms { get; }
[Static]
[Export ("ohms", ArgumentSemantic.Copy)]
NSUnitElectricResistance Ohms { get; }
[Static]
[Export ("milliohms", ArgumentSemantic.Copy)]
NSUnitElectricResistance Milliohms { get; }
[Static]
[Export ("microohms", ArgumentSemantic.Copy)]
NSUnitElectricResistance Microohms { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitEnergy : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("kilojoules", ArgumentSemantic.Copy)]
NSUnitEnergy Kilojoules { get; }
[Static]
[Export ("joules", ArgumentSemantic.Copy)]
NSUnitEnergy Joules { get; }
[Static]
[Export ("kilocalories", ArgumentSemantic.Copy)]
NSUnitEnergy Kilocalories { get; }
[Static]
[Export ("calories", ArgumentSemantic.Copy)]
NSUnitEnergy Calories { get; }
[Static]
[Export ("kilowattHours", ArgumentSemantic.Copy)]
NSUnitEnergy KilowattHours { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitFrequency : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("terahertz", ArgumentSemantic.Copy)]
NSUnitFrequency Terahertz { get; }
[Static]
[Export ("gigahertz", ArgumentSemantic.Copy)]
NSUnitFrequency Gigahertz { get; }
[Static]
[Export ("megahertz", ArgumentSemantic.Copy)]
NSUnitFrequency Megahertz { get; }
[Static]
[Export ("kilohertz", ArgumentSemantic.Copy)]
NSUnitFrequency Kilohertz { get; }
[Static]
[Export ("hertz", ArgumentSemantic.Copy)]
NSUnitFrequency Hertz { get; }
[Static]
[Export ("millihertz", ArgumentSemantic.Copy)]
NSUnitFrequency Millihertz { get; }
[Static]
[Export ("microhertz", ArgumentSemantic.Copy)]
NSUnitFrequency Microhertz { get; }
[Static]
[Export ("nanohertz", ArgumentSemantic.Copy)]
NSUnitFrequency Nanohertz { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
[Watch (6, 0), TV (13, 0), Mac (10, 15), iOS (13, 0)]
[Static]
[Export ("framesPerSecond", ArgumentSemantic.Copy)]
NSUnitFrequency FramesPerSecond { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitFuelEfficiency : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("litersPer100Kilometers", ArgumentSemantic.Copy)]
NSUnitFuelEfficiency LitersPer100Kilometers { get; }
[Static]
[Export ("milesPerImperialGallon", ArgumentSemantic.Copy)]
NSUnitFuelEfficiency MilesPerImperialGallon { get; }
[Static]
[Export ("milesPerGallon", ArgumentSemantic.Copy)]
NSUnitFuelEfficiency MilesPerGallon { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitLength : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("megameters", ArgumentSemantic.Copy)]
NSUnitLength Megameters { get; }
[Static]
[Export ("kilometers", ArgumentSemantic.Copy)]
NSUnitLength Kilometers { get; }
[Static]
[Export ("hectometers", ArgumentSemantic.Copy)]
NSUnitLength Hectometers { get; }
[Static]
[Export ("decameters", ArgumentSemantic.Copy)]
NSUnitLength Decameters { get; }
[Static]
[Export ("meters", ArgumentSemantic.Copy)]
NSUnitLength Meters { get; }
[Static]
[Export ("decimeters", ArgumentSemantic.Copy)]
NSUnitLength Decimeters { get; }
[Static]
[Export ("centimeters", ArgumentSemantic.Copy)]
NSUnitLength Centimeters { get; }
[Static]
[Export ("millimeters", ArgumentSemantic.Copy)]
NSUnitLength Millimeters { get; }
[Static]
[Export ("micrometers", ArgumentSemantic.Copy)]
NSUnitLength Micrometers { get; }
[Static]
[Export ("nanometers", ArgumentSemantic.Copy)]
NSUnitLength Nanometers { get; }
[Static]
[Export ("picometers", ArgumentSemantic.Copy)]
NSUnitLength Picometers { get; }
[Static]
[Export ("inches", ArgumentSemantic.Copy)]
NSUnitLength Inches { get; }
[Static]
[Export ("feet", ArgumentSemantic.Copy)]
NSUnitLength Feet { get; }
[Static]
[Export ("yards", ArgumentSemantic.Copy)]
NSUnitLength Yards { get; }
[Static]
[Export ("miles", ArgumentSemantic.Copy)]
NSUnitLength Miles { get; }
[Static]
[Export ("scandinavianMiles", ArgumentSemantic.Copy)]
NSUnitLength ScandinavianMiles { get; }
[Static]
[Export ("lightyears", ArgumentSemantic.Copy)]
NSUnitLength Lightyears { get; }
[Static]
[Export ("nauticalMiles", ArgumentSemantic.Copy)]
NSUnitLength NauticalMiles { get; }
[Static]
[Export ("fathoms", ArgumentSemantic.Copy)]
NSUnitLength Fathoms { get; }
[Static]
[Export ("furlongs", ArgumentSemantic.Copy)]
NSUnitLength Furlongs { get; }
[Static]
[Export ("astronomicalUnits", ArgumentSemantic.Copy)]
NSUnitLength AstronomicalUnits { get; }
[Static]
[Export ("parsecs", ArgumentSemantic.Copy)]
NSUnitLength Parsecs { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitIlluminance : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("lux", ArgumentSemantic.Copy)]
NSUnitIlluminance Lux { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitMass : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("kilograms", ArgumentSemantic.Copy)]
NSUnitMass Kilograms { get; }
[Static]
[Export ("grams", ArgumentSemantic.Copy)]
NSUnitMass Grams { get; }
[Static]
[Export ("decigrams", ArgumentSemantic.Copy)]
NSUnitMass Decigrams { get; }
[Static]
[Export ("centigrams", ArgumentSemantic.Copy)]
NSUnitMass Centigrams { get; }
[Static]
[Export ("milligrams", ArgumentSemantic.Copy)]
NSUnitMass Milligrams { get; }
[Static]
[Export ("micrograms", ArgumentSemantic.Copy)]
NSUnitMass Micrograms { get; }
[Static]
[Export ("nanograms", ArgumentSemantic.Copy)]
NSUnitMass Nanograms { get; }
[Static]
[Export ("picograms", ArgumentSemantic.Copy)]
NSUnitMass Picograms { get; }
[Static]
[Export ("ounces", ArgumentSemantic.Copy)]
NSUnitMass Ounces { get; }
[Static]
[Export ("poundsMass", ArgumentSemantic.Copy)]
NSUnitMass Pounds { get; }
[Static]
[Export ("stones", ArgumentSemantic.Copy)]
NSUnitMass Stones { get; }
[Static]
[Export ("metricTons", ArgumentSemantic.Copy)]
NSUnitMass MetricTons { get; }
[Static]
[Export ("shortTons", ArgumentSemantic.Copy)]
NSUnitMass ShortTons { get; }
[Static]
[Export ("carats", ArgumentSemantic.Copy)]
NSUnitMass Carats { get; }
[Static]
[Export ("ouncesTroy", ArgumentSemantic.Copy)]
NSUnitMass OuncesTroy { get; }
[Static]
[Export ("slugs", ArgumentSemantic.Copy)]
NSUnitMass Slugs { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitPower : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("terawatts", ArgumentSemantic.Copy)]
NSUnitPower Terawatts { get; }
[Static]
[Export ("gigawatts", ArgumentSemantic.Copy)]
NSUnitPower Gigawatts { get; }
[Static]
[Export ("megawatts", ArgumentSemantic.Copy)]
NSUnitPower Megawatts { get; }
[Static]
[Export ("kilowatts", ArgumentSemantic.Copy)]
NSUnitPower Kilowatts { get; }
[Static]
[Export ("watts", ArgumentSemantic.Copy)]
NSUnitPower Watts { get; }
[Static]
[Export ("milliwatts", ArgumentSemantic.Copy)]
NSUnitPower Milliwatts { get; }
[Static]
[Export ("microwatts", ArgumentSemantic.Copy)]
NSUnitPower Microwatts { get; }
[Static]
[Export ("nanowatts", ArgumentSemantic.Copy)]
NSUnitPower Nanowatts { get; }
[Static]
[Export ("picowatts", ArgumentSemantic.Copy)]
NSUnitPower Picowatts { get; }
[Static]
[Export ("femtowatts", ArgumentSemantic.Copy)]
NSUnitPower Femtowatts { get; }
[Static]
[Export ("horsepower", ArgumentSemantic.Copy)]
NSUnitPower Horsepower { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitPressure : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("newtonsPerMetersSquared", ArgumentSemantic.Copy)]
NSUnitPressure NewtonsPerMetersSquared { get; }
[Static]
[Export ("gigapascals", ArgumentSemantic.Copy)]
NSUnitPressure Gigapascals { get; }
[Static]
[Export ("megapascals", ArgumentSemantic.Copy)]
NSUnitPressure Megapascals { get; }
[Static]
[Export ("kilopascals", ArgumentSemantic.Copy)]
NSUnitPressure Kilopascals { get; }
[Static]
[Export ("hectopascals", ArgumentSemantic.Copy)]
NSUnitPressure Hectopascals { get; }
[Static]
[Export ("inchesOfMercury", ArgumentSemantic.Copy)]
NSUnitPressure InchesOfMercury { get; }
[Static]
[Export ("bars", ArgumentSemantic.Copy)]
NSUnitPressure Bars { get; }
[Static]
[Export ("millibars", ArgumentSemantic.Copy)]
NSUnitPressure Millibars { get; }
[Static]
[Export ("millimetersOfMercury", ArgumentSemantic.Copy)]
NSUnitPressure MillimetersOfMercury { get; }
[Static]
[Export ("poundsForcePerSquareInch", ArgumentSemantic.Copy)]
NSUnitPressure PoundsForcePerSquareInch { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitSpeed : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("metersPerSecond", ArgumentSemantic.Copy)]
NSUnitSpeed MetersPerSecond { get; }
[Static]
[Export ("kilometersPerHour", ArgumentSemantic.Copy)]
NSUnitSpeed KilometersPerHour { get; }
[Static]
[Export ("milesPerHour", ArgumentSemantic.Copy)]
NSUnitSpeed MilesPerHour { get; }
[Static]
[Export ("knots", ArgumentSemantic.Copy)]
NSUnitSpeed Knots { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[DisableDefaultCtor] // -init should never be called on NSUnit!
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSDimension))]
interface NSUnitVolume : NSSecureCoding {
// inline from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("megaliters", ArgumentSemantic.Copy)]
NSUnitVolume Megaliters { get; }
[Static]
[Export ("kiloliters", ArgumentSemantic.Copy)]
NSUnitVolume Kiloliters { get; }
[Static]
[Export ("liters", ArgumentSemantic.Copy)]
NSUnitVolume Liters { get; }
[Static]
[Export ("deciliters", ArgumentSemantic.Copy)]
NSUnitVolume Deciliters { get; }
[Static]
[Export ("centiliters", ArgumentSemantic.Copy)]
NSUnitVolume Centiliters { get; }
[Static]
[Export ("milliliters", ArgumentSemantic.Copy)]
NSUnitVolume Milliliters { get; }
[Static]
[Export ("cubicKilometers", ArgumentSemantic.Copy)]
NSUnitVolume CubicKilometers { get; }
[Static]
[Export ("cubicMeters", ArgumentSemantic.Copy)]
NSUnitVolume CubicMeters { get; }
[Static]
[Export ("cubicDecimeters", ArgumentSemantic.Copy)]
NSUnitVolume CubicDecimeters { get; }
[Static]
[Export ("cubicCentimeters", ArgumentSemantic.Copy)]
NSUnitVolume CubicCentimeters { get; }
[Static]
[Export ("cubicMillimeters", ArgumentSemantic.Copy)]
NSUnitVolume CubicMillimeters { get; }
[Static]
[Export ("cubicInches", ArgumentSemantic.Copy)]
NSUnitVolume CubicInches { get; }
[Static]
[Export ("cubicFeet", ArgumentSemantic.Copy)]
NSUnitVolume CubicFeet { get; }
[Static]
[Export ("cubicYards", ArgumentSemantic.Copy)]
NSUnitVolume CubicYards { get; }
[Static]
[Export ("cubicMiles", ArgumentSemantic.Copy)]
NSUnitVolume CubicMiles { get; }
[Static]
[Export ("acreFeet", ArgumentSemantic.Copy)]
NSUnitVolume AcreFeet { get; }
[Static]
[Export ("bushels", ArgumentSemantic.Copy)]
NSUnitVolume Bushels { get; }
[Static]
[Export ("teaspoons", ArgumentSemantic.Copy)]
NSUnitVolume Teaspoons { get; }
[Static]
[Export ("tablespoons", ArgumentSemantic.Copy)]
NSUnitVolume Tablespoons { get; }
[Static]
[Export ("fluidOunces", ArgumentSemantic.Copy)]
NSUnitVolume FluidOunces { get; }
[Static]
[Export ("cups", ArgumentSemantic.Copy)]
NSUnitVolume Cups { get; }
[Static]
[Export ("pints", ArgumentSemantic.Copy)]
NSUnitVolume Pints { get; }
[Static]
[Export ("quarts", ArgumentSemantic.Copy)]
NSUnitVolume Quarts { get; }
[Static]
[Export ("gallons", ArgumentSemantic.Copy)]
NSUnitVolume Gallons { get; }
[Static]
[Export ("imperialTeaspoons", ArgumentSemantic.Copy)]
NSUnitVolume ImperialTeaspoons { get; }
[Static]
[Export ("imperialTablespoons", ArgumentSemantic.Copy)]
NSUnitVolume ImperialTablespoons { get; }
[Static]
[Export ("imperialFluidOunces", ArgumentSemantic.Copy)]
NSUnitVolume ImperialFluidOunces { get; }
[Static]
[Export ("imperialPints", ArgumentSemantic.Copy)]
NSUnitVolume ImperialPints { get; }
[Static]
[Export ("imperialQuarts", ArgumentSemantic.Copy)]
NSUnitVolume ImperialQuarts { get; }
[Static]
[Export ("imperialGallons", ArgumentSemantic.Copy)]
NSUnitVolume ImperialGallons { get; }
[Static]
[Export ("metricCups", ArgumentSemantic.Copy)]
NSUnitVolume MetricCups { get; }
[New] // kind of overloading a static member
[Static]
[Export ("baseUnit")]
NSDimension BaseUnit { get; }
}
[iOS (10,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSMeasurement<UnitType> : NSCopying, NSSecureCoding
where UnitType : NSUnit {
[Export ("unit", ArgumentSemantic.Copy)]
NSUnit Unit { get; }
[Export ("doubleValue")]
double DoubleValue { get; }
[Export ("initWithDoubleValue:unit:")]
[DesignatedInitializer]
NativeHandle Constructor (double doubleValue, NSUnit unit);
[Export ("canBeConvertedToUnit:")]
bool CanBeConvertedTo (NSUnit unit);
[Export ("measurementByConvertingToUnit:")]
NSMeasurement<UnitType> GetMeasurementByConverting (NSUnit unit);
[Export ("measurementByAddingMeasurement:")]
NSMeasurement<UnitType> GetMeasurementByAdding (NSMeasurement<UnitType> measurement);
[Export ("measurementBySubtractingMeasurement:")]
NSMeasurement<UnitType> GetMeasurementBySubtracting (NSMeasurement<UnitType> measurement);
}
[Watch (3,0)][TV (10,0)][Mac (10,12)][iOS (10,0)]
[BaseType (typeof (NSFormatter))]
interface NSMeasurementFormatter : NSSecureCoding {
[Export ("unitOptions", ArgumentSemantic.Assign)]
NSMeasurementFormatterUnitOptions UnitOptions { get; set; }
[Export ("unitStyle", ArgumentSemantic.Assign)]
NSFormattingUnitStyle UnitStyle { get; set; }
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("numberFormatter", ArgumentSemantic.Copy)]
NSNumberFormatter NumberFormatter { get; set; }
[Export ("stringFromMeasurement:")]
string ToString (NSMeasurement<NSUnit> measurement);
[Export ("stringFromUnit:")]
string ToString (NSUnit unit);
}
[BaseType (typeof (NSObject), Name = "NSXPCConnection")]
[DisableDefaultCtor]
interface NSXpcConnection
{
[Export ("initWithServiceName:")]
[NoiOS][NoWatch][NoTV]
NativeHandle Constructor (string xpcServiceName);
[Export ("serviceName")]
string ServiceName { get; }
[Export ("initWithMachServiceName:options:")]
[NoiOS][NoWatch][NoTV]
NativeHandle Constructor (string machServiceName, NSXpcConnectionOptions options);
[Export ("initWithListenerEndpoint:")]
NativeHandle Constructor (NSXpcListenerEndpoint endpoint);
[Export ("endpoint")]
NSXpcListenerEndpoint Endpoint { get; }
[Export ("exportedInterface", ArgumentSemantic.Retain)]
[NullAllowed]
NSXpcInterface ExportedInterface { get; set; }
[Export ("exportedObject", ArgumentSemantic.Retain)]
[NullAllowed]
NSObject ExportedObject { get; set; }
[Export ("remoteObjectInterface", ArgumentSemantic.Retain)]
[NullAllowed]
NSXpcInterface RemoteInterface { get; set; }
[Export ("interruptionHandler", ArgumentSemantic.Copy)]
Action InterruptionHandler { get; set; }
[Export ("invalidationHandler", ArgumentSemantic.Copy)]
Action InvalidationHandler { get; set; }
[Export ("resume")]
void Resume ();
[Export ("suspend")]
void Suspend ();
[Export ("invalidate")]
void Invalidate ();
[Export ("auditSessionIdentifier")]
int AuditSessionIdentifier { get; }
[Export ("processIdentifier")]
int PeerProcessIdentifier { get; }
[Export ("effectiveUserIdentifier")]
int PeerEffectiveUserId { get; }
[Export ("effectiveGroupIdentifier")]
int PeerEffectiveGroupId { get; }
[Export ("currentConnection")]
[Static]
NSXpcConnection CurrentConnection { [return: NullAllowed] get; }
[Export ("scheduleSendBarrierBlock:")]
[Mac (10, 15)][iOS (13, 0)][Watch (6, 0)][TV (13, 0)]
void ScheduleSendBarrier (Action block);
[Export ("remoteObjectProxy"), Internal]
IntPtr _CreateRemoteObjectProxy ();
[Export ("remoteObjectProxyWithErrorHandler:"), Internal]
IntPtr _CreateRemoteObjectProxy ([BlockCallback] Action<NSError> errorHandler);
[Mac (10, 11)][iOS (9, 0)][Watch (2, 0)][TV (9, 0)]
[Export ("synchronousRemoteObjectProxyWithErrorHandler:"), Internal]
IntPtr _CreateSynchronousRemoteObjectProxy ([BlockCallback] Action<NSError> errorHandler);
}
interface INSXpcListenerDelegate {}
[BaseType (typeof (NSObject), Name = "NSXPCListener", Delegates = new string[] { "WeakDelegate" })]
[DisableDefaultCtor]
interface NSXpcListener
{
[Export ("serviceListener")]
[Static]
NSXpcListener ServiceListener { get; }
[Export ("anonymousListener")]
[Static]
NSXpcListener AnonymousListener { get; }
[Export ("initWithMachServiceName:")]
[DesignatedInitializer]
[NoiOS][NoTV][NoWatch]
NativeHandle Constructor (string machServiceName);
[Export ("delegate", ArgumentSemantic.Assign)]
[NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
INSXpcListenerDelegate Delegate { get; set; }
[Export ("endpoint")]
NSXpcListenerEndpoint Endpoint { get; }
[Export ("resume")]
void Resume ();
[Export ("suspend")]
void Suspend ();
[Export ("invalidate")]
void Invalidate ();
}
[BaseType (typeof (NSObject), Name = "NSXPCListenerDelegate")]
#if NET
[Protocol, Model]
#else
[Model (AutoGeneratedName = true), Protocol]
#endif
interface NSXpcListenerDelegate
{
[Export ("listener:shouldAcceptNewConnection:")]
bool ShouldAcceptConnection (NSXpcListener listener, NSXpcConnection newConnection);
}
[BaseType (typeof (NSObject), Name = "NSXPCInterface")]
[DisableDefaultCtor]
interface NSXpcInterface
{
[Export ("interfaceWithProtocol:")]
[Static]
NSXpcInterface Create (Protocol protocol);
[Export ("protocol", ArgumentSemantic.Assign)]
Protocol Protocol { get; set; }
[Export ("setClasses:forSelector:argumentIndex:ofReply:")]
void SetAllowedClasses (NSSet<Class> allowedClasses, Selector methodSelector, nuint argumentIndex, bool forReplyBlock);
[Export ("classesForSelector:argumentIndex:ofReply:")]
NSSet<Class> GetAllowedClasses (Selector methodSelector, nuint argumentIndex, bool forReplyBlock);
// Methods taking xpc_type_t have been skipped.
}
[BaseType (typeof (NSObject), Name = "NSXPCListenerEndpoint")]
[DisableDefaultCtor]
interface NSXpcListenerEndpoint : NSSecureCoding
{
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof (NSFormatter))]
interface NSListFormatter {
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[NullAllowed, Export ("itemFormatter", ArgumentSemantic.Copy)]
NSFormatter ItemFormatter { get; set; }
[Static]
[Export ("localizedStringByJoiningStrings:")]
// using `NSString[]` since they might be one (or many) `NSString` subclass(es) that handle localization
string GetLocalizedString (NSString[] joinedStrings);
[Export ("stringFromItems:")]
[return: NullAllowed]
string GetString (NSObject[] items);
[Export ("stringForObjectValue:")]
[return: NullAllowed]
string GetString ([NullAllowed] NSObject obj);
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSRelativeDateTimeFormatterStyle : long {
Numeric = 0,
Named,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSRelativeDateTimeFormatterUnitsStyle : long {
Full = 0,
SpellOut,
Short,
Abbreviated,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof (NSFormatter))]
interface NSRelativeDateTimeFormatter {
[Export ("dateTimeStyle", ArgumentSemantic.Assign)]
NSRelativeDateTimeFormatterStyle DateTimeStyle { get; set; }
[Export ("unitsStyle", ArgumentSemantic.Assign)]
NSRelativeDateTimeFormatterUnitsStyle UnitsStyle { get; set; }
[Export ("formattingContext", ArgumentSemantic.Assign)]
NSFormattingContext FormattingContext { get; set; }
[Export ("calendar", ArgumentSemantic.Copy)]
NSCalendar Calendar { get; set; }
[Export ("locale", ArgumentSemantic.Copy)]
NSLocale Locale { get; set; }
[Export ("localizedStringFromDateComponents:")]
string GetLocalizedString (NSDateComponents dateComponents);
[Export ("localizedStringFromTimeInterval:")]
string GetLocalizedString (double timeInterval);
[Export ("localizedStringForDate:relativeToDate:")]
string GetLocalizedString (NSDate date, NSDate referenceDate);
[Export ("stringForObjectValue:")]
[return: NullAllowed]
string GetString ([NullAllowed] NSObject obj);
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSCollectionChangeType : long {
Insert,
Remove,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSOrderedCollectionDifferenceCalculationOptions : ulong {
OmitInsertedObjects = (1uL << 0),
OmitRemovedObjects = (1uL << 1),
InferMoves = (1uL << 2),
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof (NSDimension))]
[DisableDefaultCtor] // NSGenericException Reason: -init should never be called on NSUnit!
interface NSUnitInformationStorage : NSSecureCoding {
// Inlined from base type
[Export ("initWithSymbol:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol);
// Inlined from base type
[Export ("initWithSymbol:converter:")]
[DesignatedInitializer]
NativeHandle Constructor (string symbol, NSUnitConverter converter);
[Static]
[Export ("bytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Bytes { get; }
[Static]
[Export ("bits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Bits { get; }
[Static]
[Export ("nibbles", ArgumentSemantic.Copy)]
NSUnitInformationStorage Nibbles { get; }
[Static]
[Export ("yottabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Yottabytes { get; }
[Static]
[Export ("zettabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Zettabytes { get; }
[Static]
[Export ("exabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Exabytes { get; }
[Static]
[Export ("petabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Petabytes { get; }
[Static]
[Export ("terabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Terabytes { get; }
[Static]
[Export ("gigabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Gigabytes { get; }
[Static]
[Export ("megabytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Megabytes { get; }
[Static]
[Export ("kilobytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Kilobytes { get; }
[Static]
[Export ("yottabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Yottabits { get; }
[Static]
[Export ("zettabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Zettabits { get; }
[Static]
[Export ("exabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Exabits { get; }
[Static]
[Export ("petabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Petabits { get; }
[Static]
[Export ("terabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Terabits { get; }
[Static]
[Export ("gigabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Gigabits { get; }
[Static]
[Export ("megabits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Megabits { get; }
[Static]
[Export ("kilobits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Kilobits { get; }
[Static]
[Export ("yobibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Yobibytes { get; }
[Static]
[Export ("zebibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Zebibytes { get; }
[Static]
[Export ("exbibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Exbibytes { get; }
[Static]
[Export ("pebibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Pebibytes { get; }
[Static]
[Export ("tebibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Tebibytes { get; }
[Static]
[Export ("gibibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Gibibytes { get; }
[Static]
[Export ("mebibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Mebibytes { get; }
[Static]
[Export ("kibibytes", ArgumentSemantic.Copy)]
NSUnitInformationStorage Kibibytes { get; }
[Static]
[Export ("yobibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Yobibits { get; }
[Static]
[Export ("zebibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Zebibits { get; }
[Static]
[Export ("exbibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Exbibits { get; }
[Static]
[Export ("pebibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Pebibits { get; }
[Static]
[Export ("tebibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Tebibits { get; }
[Static]
[Export ("gibibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Gibibits { get; }
[Static]
[Export ("mebibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Mebibits { get; }
[Static]
[Export ("kibibits", ArgumentSemantic.Copy)]
NSUnitInformationStorage Kibibits { get; }
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSUrlSessionWebSocketMessageType : long {
Data = 0,
String = 1,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof (NSObject), Name = "NSURLSessionWebSocketMessage")]
[DisableDefaultCtor]
interface NSUrlSessionWebSocketMessage {
[Export ("initWithData:")]
[DesignatedInitializer]
NativeHandle Constructor (NSData data);
[Export ("initWithString:")]
[DesignatedInitializer]
NativeHandle Constructor (string @string);
[Export ("type")]
NSUrlSessionWebSocketMessageType Type { get; }
[NullAllowed, Export ("data", ArgumentSemantic.Copy)]
NSData Data { get; }
[NullAllowed, Export ("string")]
string String { get; }
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSUrlSessionWebSocketCloseCode : long {
Invalid = 0,
NormalClosure = 1000,
GoingAway = 1001,
ProtocolError = 1002,
UnsupportedData = 1003,
NoStatusReceived = 1005,
AbnormalClosure = 1006,
InvalidFramePayloadData = 1007,
PolicyViolation = 1008,
MessageTooBig = 1009,
MandatoryExtensionMissing = 1010,
InternalServerError = 1011,
TlsHandshakeFailure = 1015,
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[BaseType (typeof (NSUrlSessionTask), Name = "NSURLSessionWebSocketTask")]
[DisableDefaultCtor]
interface NSUrlSessionWebSocketTask {
[Export ("sendMessage:completionHandler:")]
[Async]
void SendMessage (NSUrlSessionWebSocketMessage message, Action<NSError> completionHandler);
[Export ("receiveMessageWithCompletionHandler:")]
[Async]
void ReceiveMessage (Action<NSUrlSessionWebSocketMessage, NSError> completionHandler);
[Export ("sendPingWithPongReceiveHandler:")]
[Async]
void SendPing (Action<NSError> pongReceiveHandler);
[Export ("cancelWithCloseCode:reason:")]
void Cancel (NSUrlSessionWebSocketCloseCode closeCode, [NullAllowed] NSData reason);
[Export ("maximumMessageSize")]
nint MaximumMessageSize { get; set; }
[Export ("closeCode")]
NSUrlSessionWebSocketCloseCode CloseCode { get; }
[NullAllowed, Export ("closeReason", ArgumentSemantic.Copy)]
NSData CloseReason { get; }
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#if NET
[Protocol][Model]
#else
[Protocol][Model (AutoGeneratedName = true)]
#endif
[BaseType (typeof (NSUrlSessionTaskDelegate), Name = "NSURLSessionWebSocketDelegate")]
interface NSUrlSessionWebSocketDelegate {
[Export ("URLSession:webSocketTask:didOpenWithProtocol:")]
void DidOpen (NSUrlSession session, NSUrlSessionWebSocketTask webSocketTask, [NullAllowed] string protocol);
[Export ("URLSession:webSocketTask:didCloseWithCode:reason:")]
void DidClose (NSUrlSession session, NSUrlSessionWebSocketTask webSocketTask, NSUrlSessionWebSocketCloseCode closeCode, [NullAllowed] NSData reason);
}
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
[Native]
enum NSUrlErrorNetworkUnavailableReason : long {
Cellular = 0,
Expensive = 1,
Constrained = 2,
}
[NoWatch, NoTV, NoiOS, Mac (10,10)]
[Native]
public enum NSBackgroundActivityResult : long
{
Finished = 1,
Deferred = 2,
}
delegate void NSBackgroundActivityCompletionHandler (NSBackgroundActivityResult result);
delegate void NSBackgroundActivityCompletionAction ([BlockCallback] NSBackgroundActivityCompletionHandler handler);
[NoWatch, NoTV, NoiOS, Mac (10,10)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface NSBackgroundActivityScheduler
{
[Export ("initWithIdentifier:")]
[DesignatedInitializer]
NativeHandle Constructor (string identifier);
[Export ("identifier")]
string Identifier { get; }
[Export ("qualityOfService", ArgumentSemantic.Assign)]
NSQualityOfService QualityOfService { get; set; }
[Export ("repeats")]
bool Repeats { get; set; }
[Export ("interval")]
double Interval { get; set; }
[Export ("tolerance")]
double Tolerance { get; set; }
[Export ("scheduleWithBlock:")]
void Schedule (NSBackgroundActivityCompletionAction action);
[Export ("invalidate")]
void Invalidate ();
[Export ("shouldDefer")]
bool ShouldDefer { get; }
}
[Watch (7,0), TV (14,0), Mac (11,0), iOS (14,0)]
[Native]
public enum NSUrlSessionTaskMetricsDomainResolutionProtocol : long {
Unknown,
Udp,
Tcp,
Tls,
Https,
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15, 0)]
[Native]
public enum NSNotificationSuspensionBehavior : ulong {
Drop = 1,
Coalesce = 2,
Hold = 3,
DeliverImmediately = 4,
}
[NoiOS][NoTV][NoWatch]
[MacCatalyst(15, 0)]
[Flags]
[Native]
public enum NSNotificationFlags : ulong {
DeliverImmediately = (1 << 0),
PostToAllSessions = (1 << 1),
}
[Mac (10,11)][NoWatch][NoTV][NoiOS][NoMacCatalyst]
[Native]
[Flags]
public enum NSFileManagerUnmountOptions : ulong
{
AllPartitionsAndEjectDisk = 1 << 0,
WithoutUI = 1 << 1,
}
}
| 32.749353 | 241 | 0.73314 | [
"BSD-3-Clause"
] | stephen-hawley/xamarin-macios | src/foundation.cs | 543,803 | C# |
using System;
using System.IO;
namespace SpecsFor.Mvc
{
public static class Project
{
public static string Named(string projectName)
{
Console.WriteLine("Beginning search for project '{0}' in directory '{1}'...", projectName, Environment.CurrentDirectory);
var directory = new DirectoryInfo(Environment.CurrentDirectory);
while (directory.GetFiles("*.sln").Length == 0)
{
if (directory.Parent == null)
{
var errorMessage = string.Format("Unable to find solution file, traversed up to '{0}'. Your test runner may be using shadow-copy to create a clone of your working directory. The Project.Named method does not currently support this behavior. You must manually specify the path to the project to be tested instead.", directory.FullName);
throw new InvalidOperationException(errorMessage);
}
directory = directory.Parent;
}
return Path.Combine(directory.FullName, projectName);
}
}
} | 32.533333 | 344 | 0.704918 | [
"MIT"
] | milesibastos/SpecsFor | SpecsFor.Mvc/Project.cs | 976 | C# |
using System;
using System.Linq;
using Datadog.Trace.ClrProfiler.Integrations;
using Datadog.Trace.ExtensionMethods;
using Datadog.Trace.TestHelpers;
using Xunit;
using Xunit.Abstractions;
namespace Datadog.Trace.ClrProfiler.IntegrationTests
{
public class ServiceStackRedisTests : TestHelper
{
public ServiceStackRedisTests(ITestOutputHelper output)
: base("RedisCore", output)
{
}
[Fact]
[Trait("Category", "EndToEnd")]
public void SubmitsTraces()
{
int agentPort = TcpPortProvider.GetOpenPort();
var prefix = $"{BuildParameters.Configuration}.{BuildParameters.TargetFramework}.";
using (var agent = new MockTracerAgent(agentPort))
using (var processResult = RunSampleAndWaitForExit(agent.Port, arguments: $"ServiceStack {prefix}"))
{
Assert.True(processResult.ExitCode >= 0, $"Process exited with code {processResult.ExitCode}");
// note: ignore the INFO command because it's timing is unpredictable (on Linux?)
var spans = agent.WaitForSpans(11)
.Where(s => s.Type == "redis" && s.Resource != "INFO")
.OrderBy(s => s.Start)
.ToList();
var host = Environment.GetEnvironmentVariable("REDIS_HOST") ?? "localhost";
foreach (var span in spans)
{
Assert.Equal("redis.command", span.Name);
Assert.Equal("Samples.RedisCore-redis", span.Service);
Assert.Equal(SpanTypes.Redis, span.Type);
Assert.Equal(host, span.Tags.GetValueOrDefault("out.host"));
Assert.Equal("6379", span.Tags.GetValueOrDefault("out.port"));
}
var expected = new TupleList<string, string>
{
{ "ROLE", "ROLE" },
{ "SET", $"SET {prefix}ServiceStack.Redis.INCR 0" },
{ "PING", "PING" },
{ "DDCUSTOM", "DDCUSTOM COMMAND" },
{ "ECHO", "ECHO Hello World" },
{ "SLOWLOG", "SLOWLOG GET 5" },
{ "INCR", $"INCR {prefix}ServiceStack.Redis.INCR" },
{ "INCRBYFLOAT", $"INCRBYFLOAT {prefix}ServiceStack.Redis.INCR 1.25" },
{ "TIME", "TIME" },
{ "SELECT", "SELECT 0" },
};
for (int i = 0; i < expected.Count; i++)
{
var e1 = expected[i].Item1;
var e2 = expected[i].Item2;
var a1 = i < spans.Count
? spans[i].Resource
: string.Empty;
var a2 = i < spans.Count
? spans[i].Tags.GetValueOrDefault("redis.raw_command")
: string.Empty;
Assert.True(e1 == a1, $@"invalid resource name for span #{i}, expected ""{e1}"", actual ""{a1}""");
Assert.True(e2 == a2, $@"invalid raw command for span #{i}, expected ""{e2}"" != ""{a2}""");
}
}
}
}
}
| 41.4 | 119 | 0.48913 | [
"Apache-2.0"
] | alonf/dd-trace-dotnet | test/Datadog.Trace.ClrProfiler.IntegrationTests/ServiceStackRedisTests.cs | 3,312 | C# |
namespace RiotSharp.StaticDataEndpoint
{
class ChampionListStaticWrapper
{
public ChampionListStatic ChampionListStatic { get; private set; }
public Language Language { get; private set; }
public ChampionData ChampionData { get; private set; }
public ChampionListStaticWrapper(ChampionListStatic champions, Language language, ChampionData championData)
{
ChampionListStatic = champions;
Language = language;
ChampionData = championData;
}
}
}
| 31.823529 | 116 | 0.672828 | [
"MIT"
] | TRangeman/RSharp | RiotSharp/StaticDataEndpoint/Champion/Cache/ChampionListStaticWrapper.cs | 543 | C# |
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace HouseToolBox.Api.Data.Migrations
{
public partial class purchasedOrderAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Price",
table: "Products");
migrationBuilder.AddColumn<decimal>(
name: "Price",
table: "Orders",
nullable: false,
defaultValue: 0m);
migrationBuilder.CreateTable(
name: "PurchasedOrders",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
IdProduct = table.Column<Guid>(nullable: false),
Price = table.Column<decimal>(nullable: false),
PurchaseDate = table.Column<DateTime>(nullable: false),
Quantity = table.Column<decimal>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PurchasedOrders", x => x.Id);
table.ForeignKey(
name: "FK_PurchasedOrders_Products_IdProduct",
column: x => x.IdProduct,
principalTable: "Products",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_PurchasedOrders_IdProduct",
table: "PurchasedOrders",
column: "IdProduct");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PurchasedOrders");
migrationBuilder.DropColumn(
name: "Price",
table: "Orders");
migrationBuilder.AddColumn<decimal>(
name: "Price",
table: "Products",
nullable: false,
defaultValue: 0m);
}
}
}
| 33.969231 | 75 | 0.504982 | [
"MIT"
] | Djangoum/HouseToolBox | HouseToolBox.Api.Data/Migrations/20180218233841_purchasedOrderAdded.cs | 2,210 | C# |
using Debwin.Core.Parsers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Debwin.Core;
namespace combit.DebwinExtensions.Parsers
{
public class BinaryDummyMessageParser : IMessageParser
{
public LogMessage CreateMessageFrom(object rawMessage)
{
var data = rawMessage as byte[];
return new LogMessage("received package, length: " + data.Length);
}
public IEnumerable<int> GetSupportedMessageTypeCodes()
{
return new int[] { LogMessage.TYPECODE_DEFAULT_MESSAGE };
}
}
}
| 24.52 | 78 | 0.668842 | [
"MIT"
] | combit/Debwin | combit.DebwinExtensions/Parsers/BinaryDummyMessageParser.cs | 615 | C# |
using Xamarin.Forms;
namespace BindFromControlTemplateToViewModel
{
public class CardView : ContentView
{
public static readonly BindableProperty CardNameProperty = BindableProperty.Create(nameof(CardName), typeof(string), typeof(CardView), string.Empty);
public static readonly BindableProperty CardDescriptionProperty = BindableProperty.Create(nameof(CardDescription), typeof(string), typeof(CardView), string.Empty);
public static readonly BindableProperty BorderColorProperty = BindableProperty.Create(nameof(BorderColor), typeof(Color), typeof(CardView), Color.DarkGray);
public static readonly BindableProperty CardColorProperty = BindableProperty.Create(nameof(CardColor), typeof(Color), typeof(CardView), Color.White);
public string CardName
{
get => (string)GetValue(CardView.CardNameProperty);
set => SetValue(CardView.CardNameProperty, value);
}
public string CardDescription
{
get => (string)GetValue(CardView.CardDescriptionProperty);
set => SetValue(CardView.CardDescriptionProperty, value);
}
public Color BorderColor
{
get => (Color)GetValue(CardView.BorderColorProperty);
set => SetValue(CardView.BorderColorProperty, value);
}
public Color CardColor
{
get => (Color)GetValue(CardView.CardColorProperty);
set => SetValue(CardView.CardColorProperty, value);
}
}
}
| 41.135135 | 171 | 0.68594 | [
"MIT"
] | JaridKG/xamarin-forms | BindFromControlTemplateToViewModel/BindFromControlTemplateToViewModel/CardView.cs | 1,524 | C# |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Utilities;
namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal
{
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public class EntityProjectionExpression : Expression, IPrintableExpression, IAccessExpression
{
private readonly IDictionary<IProperty, IAccessExpression> _propertyExpressionsCache
= new Dictionary<IProperty, IAccessExpression>();
private readonly IDictionary<INavigation, IAccessExpression> _navigationExpressionsCache
= new Dictionary<INavigation, IAccessExpression>();
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public EntityProjectionExpression([NotNull] IEntityType entityType, [NotNull] Expression accessExpression)
{
EntityType = entityType;
AccessExpression = accessExpression;
Name = (accessExpression as IAccessExpression)?.Name;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public sealed override ExpressionType NodeType => ExpressionType.Extension;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public override Type Type => EntityType.ClrType;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression AccessExpression { get; }
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual IEntityType EntityType { get; }
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual string Name { get; }
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
protected override Expression VisitChildren(ExpressionVisitor visitor)
{
Check.NotNull(visitor, nameof(visitor));
return Update(visitor.Visit(AccessExpression));
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression Update([NotNull] Expression accessExpression)
=> accessExpression != AccessExpression
? new EntityProjectionExpression(EntityType, accessExpression)
: this;
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression BindProperty([NotNull] IProperty property, bool clientEval)
{
if (!EntityType.IsAssignableFrom(property.DeclaringEntityType)
&& !property.DeclaringEntityType.IsAssignableFrom(EntityType))
{
throw new InvalidOperationException(
$"Called EntityProjectionExpression.GetProperty() with incorrect IProperty. EntityType:{EntityType.DisplayName()}, Property:{property.Name}");
}
if (!_propertyExpressionsCache.TryGetValue(property, out var expression))
{
expression = new KeyAccessExpression(property, AccessExpression);
_propertyExpressionsCache[property] = expression;
}
if (!clientEval
&& expression.Name.Length == 0)
{
// Non-persisted property can't be translated
return null;
}
return (Expression)expression;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression BindNavigation([NotNull] INavigation navigation, bool clientEval)
{
if (!EntityType.IsAssignableFrom(navigation.DeclaringEntityType)
&& !navigation.DeclaringEntityType.IsAssignableFrom(EntityType))
{
throw new InvalidOperationException(
$"Called EntityProjectionExpression.GetNavigation() with incorrect INavigation. EntityType:{EntityType.DisplayName()}, Navigation:{navigation.Name}");
}
if (!_navigationExpressionsCache.TryGetValue(navigation, out var expression))
{
if (navigation.IsCollection())
{
expression = new ObjectArrayProjectionExpression(navigation, AccessExpression);
}
else
{
expression = new EntityProjectionExpression(
navigation.GetTargetType(),
new ObjectAccessExpression(navigation, AccessExpression));
}
_navigationExpressionsCache[navigation] = expression;
}
if (!clientEval
&& expression.Name.Length == 0)
{
// Non-persisted navigation can't be translated
return null;
}
return (Expression)expression;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression BindMember(
[NotNull] string name, [NotNull] Type entityClrType, bool clientEval, [NotNull] out IPropertyBase propertyBase)
=> BindMember(MemberIdentity.Create(name), entityClrType, clientEval, out propertyBase);
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual Expression BindMember(
[NotNull] MemberInfo memberInfo, [NotNull] Type entityClrType, bool clientEval, [NotNull] out IPropertyBase propertyBase)
=> BindMember(MemberIdentity.Create(memberInfo), entityClrType, clientEval, out propertyBase);
private Expression BindMember(MemberIdentity member, Type entityClrType, bool clientEval, out IPropertyBase propertyBase)
{
var entityType = EntityType;
if (entityClrType != null
&& !entityClrType.IsAssignableFrom(entityType.ClrType))
{
entityType = entityType.GetDerivedTypes().First(e => entityClrType.IsAssignableFrom(e.ClrType));
}
var property = member.MemberInfo == null
? entityType.FindProperty(member.Name)
: entityType.FindProperty(member.MemberInfo);
if (property != null)
{
propertyBase = property;
return BindProperty(property, clientEval);
}
var navigation = member.MemberInfo == null
? entityType.FindNavigation(member.Name)
: entityType.FindNavigation(member.MemberInfo);
if (navigation != null)
{
propertyBase = navigation;
return BindNavigation(navigation, clientEval);
}
// Entity member not found
propertyBase = null;
return null;
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public virtual void Print(ExpressionPrinter expressionPrinter)
{
Check.NotNull(expressionPrinter, nameof(expressionPrinter));
expressionPrinter.Visit(AccessExpression);
}
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public override bool Equals(object obj)
=> obj != null
&& (ReferenceEquals(this, obj)
|| obj is EntityProjectionExpression entityProjectionExpression
&& Equals(entityProjectionExpression));
private bool Equals(EntityProjectionExpression entityProjectionExpression)
=> Equals(EntityType, entityProjectionExpression.EntityType)
&& AccessExpression.Equals(entityProjectionExpression.AccessExpression);
/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
/// the same compatibility standards as public APIs. It may be changed or removed without notice in
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public override int GetHashCode() => HashCode.Combine(EntityType, AccessExpression);
}
}
| 55.557621 | 170 | 0.655069 | [
"Apache-2.0"
] | Pilchie/efcore | src/EFCore.Cosmos/Query/Internal/EntityProjectionExpression.cs | 14,945 | C# |
using System.Collections.Generic;
using PhotoGallery.Entities;
namespace PhotoGallery.Infrastructure.Services
{
public interface IMembershipService
{
MembershipContext ValidateUser(string username, string password);
User CreateUser(string username, string email, string password, int[] roles);
User GetUser(int userId);
List<Role> GetUserRoles(string username);
}
}
| 29.428571 | 85 | 0.73301 | [
"MIT"
] | ramesh-sharma12/asp.net-core-angular2-seed | src/PhotoGallery/Infrastructure/Services/Abstract/IMembershipService.cs | 414 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AccountSvc.Models;
using AccountSvc.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Web.Models;
namespace AccountSvc.Controllers
{
[Route("[controller]/[action]")]
[ApiController]
public class AccountController : ControllerBase
{
readonly IAccountSvc _svc;
readonly IConfiguration cfg;
const string help = @"The Account service is alive! Try GET /api/v1/account/{account-id}";
public AccountController(IAccountSvc svc, IConfiguration cfg)
{
this._svc = svc;
this.cfg = cfg;
}
[Route("/ping")]
public IActionResult Ping()
{
return Ok();
}
[Route("/help")]
public IActionResult Help()
{
return Ok(help);
}
[HttpPost]
[Route("/api/v1/account/")]
public async Task<IActionResult> CreateAccount([FromBody] CreateAccount account)
{
await _svc.CreateAccount(account);
return Ok();
}
[HttpPut]
[Route("/api/v1/account/")]
public async Task<IActionResult> UpdateAccount([FromBody] UpdateAccount account)
{
await _svc.UpdateAccount(account);
return Ok();
}
[HttpPost]
[Route("/api/v1/account/update-password")]
public async Task<IActionResult> UpdatePassword([FromBody] UpdatePassword updPassword)
{
await _svc.UpdatePassword(updPassword);
return Ok();
}
[HttpPost]
[Route("/api/v1/account/signin")]
public async Task<IActionResult> SignIn([FromBody] SignIn signin)
{
var acct = await _svc.TrySignIn(signin);
return Ok(acct);
}
[Route("/api/v1/account/{id}")]
public async Task<Account> GetAccount(string id)
{
return await _svc.GetAccountById(id);
}
[Route("/api/v1/account/search")]
public async Task<Account> GetAccountByEmail(string email)
{
return await _svc.GetAccountByEmail(email);
}
[Route("/api/v1/account/address/{addrId}")]
public async Task<Address> GetAddressById(string addrId)
{
return await _svc.GetAddressById(addrId);
}
[Route("/api/v1/account/address/")]
[HttpPost]
public async Task AddAddress([FromBody]Address addr)
{
await _svc.AddAddress(addr);
}
[Route("/api/v1/account/address/")]
[HttpPut]
public async Task UpdateAddress([FromBody]Address addr)
{
await _svc.UpdateAddress(addr);
}
[Route("/api/v1/account/address/{addressId}")]
[HttpDelete]
public async Task RemoveAddress(string addressId)
{
await _svc.RemoveAddress(addressId);
}
[Route("/api/v1/account/address/search")]
public async Task<IList<Address>> GetAddressesByAccountId(string accountId)
{
return await _svc.GetAddressesByAccountId(accountId);
}
[Route("/api/v1/account/address/default")]
public async Task SetDefaultAddress(string accountId, int addressId)
{
await _svc.SetDefultAddress(accountId, addressId);
}
[Route("/api/v1/account/payment/{pmtId}")]
public async Task<PaymentInfo> GetPaymentInfoById(string pmtId)
{
return await _svc.GetPaymentInfoById(pmtId);
}
[HttpPost]
[Route("/api/v1/account/payment/")]
public async Task AddPaymentInfo([FromBody]PaymentInfo pmtInfo)
{
await _svc.AddPaymentInfo(pmtInfo);
}
[HttpPut]
[Route("/api/v1/account/payment/")]
public async Task UpdatePaymentInfo([FromBody]PaymentInfo pmtInfo)
{
await _svc.UpdatePaymentInfo(pmtInfo);
}
[Route("/api/v1/account/payment/{pmtId}")]
[HttpDelete]
public async Task RemovePaymentInfo(string pmtId)
{
await _svc.RemovePaymentInfo(pmtId);
}
[Route("/api/v1/account/payment/search")]
public async Task<IList<PaymentInfo>> GetPaymentInfosByAccountId(string accountId)
{
return await _svc.GetPaymentInfosByAccountId(accountId);
}
[Route("/api/v1/account/payment/default")]
public async Task SetDefaultPaymentInfo(string accountId, int pmtId)
{
await _svc.SetDefaultPaymentInfo(accountId, pmtId);
}
[Route("/api/v1/account/history/{acctId}")]
public async Task<IList<AccountHistory>> GetAccountHistory(string acctId)
{
return await _svc.GetAccountHistory(acctId);
}
}
}
| 30.410714 | 99 | 0.572519 | [
"MIT"
] | hd9/aspnet-microservices | src/AccountSvc/Controllers/AccountController.cs | 5,111 | C# |
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Kalmit.PersistentProcess.WebHost
{
static public class Asp
{
class ClientsRateLimitStateContainer
{
readonly public ConcurrentDictionary<string, RateLimitMutableContainer> RateLimitFromClientId =
new ConcurrentDictionary<string, RateLimitMutableContainer>();
}
static public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton(new ClientsRateLimitStateContainer());
}
static public async Task MiddlewareFromWebAppConfig(
WebAppConfiguration webAppConfig, HttpContext context, Func<Task> next) =>
await StaticFilesMiddlewareFromWebAppConfig(webAppConfig, context,
() => RateLimitMiddlewareFromWebAppConfig(webAppConfig, context,
() => AdminPersistentProcessMiddlewareFromWebAppConfig(webAppConfig, context, next)));
static async Task StaticFilesMiddlewareFromWebAppConfig(
WebAppConfiguration webAppConfig, HttpContext context, Func<Task> next)
{
var matchingUrlMapToStaticFile =
webAppConfig?.Map?.mapsFromRequestUrlToStaticFileName
?.FirstOrDefault(conditionalMap =>
Regex.IsMatch(context.Request.GetDisplayUrl(), conditionalMap.matchingRegexPattern));
if (matchingUrlMapToStaticFile != null)
{
if (!string.Equals("get", context.Request.Method, StringComparison.InvariantCultureIgnoreCase))
{
context.Response.StatusCode = 405;
await context.Response.WriteAsync("This resource only supports the GET method.");
return;
}
var staticFile =
webAppConfig?.StaticFiles
?.FirstOrDefault(staticFileNameAndContent =>
string.Equals(staticFileNameAndContent.staticFileName, matchingUrlMapToStaticFile.resultString));
if (staticFile?.staticFileContent == null)
{
context.Response.StatusCode = 404;
return;
}
context.Response.StatusCode = 200;
await context.Response.Body.WriteAsync(staticFile?.staticFileContent, 0, staticFile.Value.staticFileContent.Length);
return;
}
await next?.Invoke();
}
static async Task RateLimitMiddlewareFromWebAppConfig(
WebAppConfiguration webAppConfig, HttpContext context, Func<Task> next)
{
string ClientId()
{
const string defaultClientId = "MapToIPv4-failed";
try
{
return context.Connection.RemoteIpAddress?.MapToIPv4().ToString() ?? defaultClientId;
}
catch
{
return defaultClientId;
}
}
var rateLimitFromClientId =
context.RequestServices.GetService<ClientsRateLimitStateContainer>().RateLimitFromClientId;
var clientRateLimitState =
rateLimitFromClientId.GetOrAdd(
ClientId(), _ => BuildRateLimitContainerForClient(webAppConfig?.Map));
if (clientRateLimitState?.AttemptPass(Configuration.GetDateTimeOffset(context).ToUnixTimeMilliseconds()) ?? true)
{
await next?.Invoke();
return;
}
context.Response.StatusCode = 429;
await context.Response.WriteAsync("");
return;
}
static RateLimitMutableContainer BuildRateLimitContainerForClient(WebAppConfigurationMap map)
{
if (map?.singleRateLimitWindowPerClientIPv4Address == null)
return null;
return new RateLimitMutableContainer(new RateLimitStateSingleWindow
{
limit = map.singleRateLimitWindowPerClientIPv4Address.limit,
windowSize = map.singleRateLimitWindowPerClientIPv4Address.windowSizeInMs,
});
}
static async Task AdminPersistentProcessMiddlewareFromWebAppConfig(
WebAppConfiguration webAppConfig, HttpContext context, Func<Task> next)
{
if (context.Request.Path.StartsWithSegments(
new PathString(Configuration.AdminPath),
out var requestPathInAdmin))
{
var configuration = context.RequestServices.GetService<IConfiguration>();
var rootPassword = configuration.GetValue<string>(Configuration.AdminRootPasswordSettingKey);
var expectedAuthorization = Configuration.BasicAuthenticationForAdminRoot(rootPassword);
context.Request.Headers.TryGetValue("Authorization", out var requestAuthorizationHeaderValue);
AuthenticationHeaderValue.TryParse(
requestAuthorizationHeaderValue.FirstOrDefault(), out var requestAuthorization);
if (!(0 < rootPassword?.Length))
{
context.Response.StatusCode = 403;
await context.Response.WriteAsync("Forbidden");
return;
}
var buffer = new byte[400];
var decodedRequestAuthorizationParameter =
Convert.TryFromBase64String(requestAuthorization?.Parameter ?? "", buffer, out var bytesWritten) ?
Encoding.UTF8.GetString(buffer, 0, bytesWritten) : null;
if (!(string.Equals(expectedAuthorization, decodedRequestAuthorizationParameter) &&
string.Equals("basic", requestAuthorization?.Scheme, StringComparison.OrdinalIgnoreCase)))
{
context.Response.StatusCode = 401;
context.Response.Headers.Add(
"WWW-Authenticate",
@"Basic realm=""" + context.Request.Host + Configuration.AdminPath + @""", charset=""UTF-8""");
await context.Response.WriteAsync("Unauthorized");
return;
}
if (string.Equals(requestPathInAdmin, Configuration.ApiPersistentProcessStatePath))
{
if (string.Equals(context.Request.Method, "post", StringComparison.InvariantCultureIgnoreCase))
{
var stateToSet = new StreamReader(context.Request.Body, System.Text.Encoding.UTF8).ReadToEndAsync().Result;
var processStoreWriter = context.RequestServices.GetService<ProcessStore.IProcessStoreWriter>();
var persistentProcess = context.RequestServices.GetService<IPersistentProcess>();
var compositionRecord = persistentProcess.SetState(stateToSet);
processStoreWriter.AppendSerializedCompositionRecord(compositionRecord.serializedCompositionRecord);
context.Response.StatusCode = 200;
await context.Response.WriteAsync("Successfully set process state.");
return;
}
if (string.Equals(context.Request.Method, "get", StringComparison.InvariantCultureIgnoreCase))
{
var persistentProcess = context.RequestServices.GetService<IPersistentProcess>();
var reducedValueLiteralString =
persistentProcess.ReductionRecordForCurrentState().ReducedValueLiteralString;
context.Response.StatusCode = 200;
await context.Response.WriteAsync(reducedValueLiteralString);
return;
}
context.Response.StatusCode = 405;
await context.Response.WriteAsync("Method not supported.");
return;
}
context.Response.StatusCode = 404;
await context.Response.WriteAsync("Not Found");
return;
}
await next?.Invoke();
}
static public InterfaceToHost.HttpRequest AsPersistentProcessInterfaceHttpRequest(
HttpRequest httpRequest)
{
var httpHeaders =
httpRequest.Headers
.Select(header => new InterfaceToHost.HttpHeader { name = header.Key, values = header.Value.ToArray() })
.ToArray();
return new InterfaceToHost.HttpRequest
{
method = httpRequest.Method,
uri = httpRequest.GetDisplayUrl(),
bodyAsString = new System.IO.StreamReader(httpRequest.Body).ReadToEndAsync().Result,
headers = httpHeaders,
};
}
}
} | 42.463636 | 132 | 0.598587 | [
"MIT"
] | Viir/Kalmit | implement/PersistentProcess/PersistentProcess.WebHost/Asp.cs | 9,342 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.Compute
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// VirtualMachinesOperations operations.
/// </summary>
public partial interface IVirtualMachinesOperations
{
/// <summary>
/// Gets all the virtual machines under the specified subscription for
/// the specified location.
/// </summary>
/// <param name='location'>
/// The location for which virtual machines under the subscription are
/// queried.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListByLocationWithHttpMessagesAsync(string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Captures the VM by copying virtual hard disks of the VM and outputs
/// a template that can be used to create similar VMs.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Capture Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineCaptureResult>> CaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to create or update a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Create Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachine>> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to update a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Update Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachine>> UpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to delete a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> DeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Retrieves information about the model view or the instance view of
/// a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='expand'>
/// The expand expression to apply on the operation. Possible values
/// include: 'instanceView'
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachine>> GetWithHttpMessagesAsync(string resourceGroupName, string vmName, InstanceViewTypes? expand = default(InstanceViewTypes?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Retrieves information about the run-time state of a virtual
/// machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineInstanceView>> InstanceViewWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Converts virtual machine disks from blob-based to managed disks.
/// Virtual machine must be stop-deallocated before invoking this
/// operation.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> ConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Shuts down the virtual machine and releases the compute resources.
/// You are not billed for the compute resources that this virtual
/// machine uses.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> DeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Sets the state of the virtual machine to generalized.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> GeneralizeWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all of the virtual machines in the specified resource group.
/// Use the nextLink property in the response to get the next page of
/// virtual machines.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all of the virtual machines in the specified subscription.
/// Use the nextLink property in the response to get the next page of
/// virtual machines.
/// </summary>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListAllWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all available virtual machine sizes to which the specified
/// virtual machine can be resized.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IEnumerable<VirtualMachineSize>>> ListAvailableSizesWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to power off (stop) a virtual machine. The virtual
/// machine can be restarted with the same provisioned resources. You
/// are still charged for this virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='skipShutdown'>
/// The parameter to request non-graceful VM shutdown. True value for
/// this flag indicates non-graceful shutdown whereas false indicates
/// otherwise. Default value for this flag is false if not specified
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> PowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to restart a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> RestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to start a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> StartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to redeploy a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> RedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Reimages the virtual machine which has an ephemeral OS disk back to
/// its initial state.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='tempDisk'>
/// Specifies whether to reimage temp disk. Default value: false.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> ReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? tempDisk = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to perform maintenance on a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> PerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Run command on the VM.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Run command operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<RunCommandResult>> RunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Captures the VM by copying virtual hard disks of the VM and outputs
/// a template that can be used to create similar VMs.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Capture Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachineCaptureResult>> BeginCaptureWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineCaptureParameters parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to create or update a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Create Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachine>> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachine parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to update a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Update Virtual Machine operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<VirtualMachine>> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string vmName, VirtualMachineUpdate parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to delete a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Converts virtual machine disks from blob-based to managed disks.
/// Virtual machine must be stop-deallocated before invoking this
/// operation.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginConvertToManagedDisksWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Shuts down the virtual machine and releases the compute resources.
/// You are not billed for the compute resources that this virtual
/// machine uses.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginDeallocateWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to power off (stop) a virtual machine. The virtual
/// machine can be restarted with the same provisioned resources. You
/// are still charged for this virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='skipShutdown'>
/// The parameter to request non-graceful VM shutdown. True value for
/// this flag indicates non-graceful shutdown whereas false indicates
/// otherwise. Default value for this flag is false if not specified
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginPowerOffWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? skipShutdown = false, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to restart a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginRestartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to start a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginStartWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to redeploy a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginRedeployWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Reimages the virtual machine which has an ephemeral OS disk back to
/// its initial state.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='tempDisk'>
/// Specifies whether to reimage temp disk. Default value: false.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginReimageWithHttpMessagesAsync(string resourceGroupName, string vmName, bool? tempDisk = default(bool?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// The operation to perform maintenance on a virtual machine.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse> BeginPerformMaintenanceWithHttpMessagesAsync(string resourceGroupName, string vmName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Run command on the VM.
/// </summary>
/// <param name='resourceGroupName'>
/// The name of the resource group.
/// </param>
/// <param name='vmName'>
/// The name of the virtual machine.
/// </param>
/// <param name='parameters'>
/// Parameters supplied to the Run command operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<RunCommandResult>> BeginRunCommandWithHttpMessagesAsync(string resourceGroupName, string vmName, RunCommandInput parameters, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets all the virtual machines under the specified subscription for
/// the specified location.
/// </summary>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListByLocationNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all of the virtual machines in the specified resource group.
/// Use the nextLink property in the response to get the next page of
/// virtual machines.
/// </summary>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Lists all of the virtual machines in the specified subscription.
/// Use the nextLink property in the response to get the next page of
/// virtual machines.
/// </summary>
/// <param name='nextPageLink'>
/// The NextLink from the previous successful call to List operation.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
/// Thrown when unable to deserialize the response
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
/// Thrown when a required parameter is null
/// </exception>
Task<AzureOperationResponse<IPage<VirtualMachine>>> ListAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
| 49.685065 | 306 | 0.618789 | [
"MIT"
] | 0xced/azure-sdk-for-net | src/SDKs/Compute/Management.Compute/Generated/IVirtualMachinesOperations.cs | 45,909 | C# |
using ApplicationBase;
using ApplicationBase.Infrastructure.Common;
using Autofac;
using InfrastructureBase;
using InfrastructureBase.EfDataAccess;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using UserServiceInterface.UseCase;
namespace JobRunner
{
public class CustomerService: IHostedService
{
public CustomerService(DefContext defContext)
{
defContext.Database.EnsureCreated();//自动迁移数据库
}
public async Task StartAsync(CancellationToken cancellationToken)
{
await Task.CompletedTask;
}
public async Task StopAsync(CancellationToken cancellationToken)
{
await Task.CompletedTask;
}
}
}
| 26.911765 | 73 | 0.733333 | [
"MIT"
] | sd797994/Oxygen-EshopSample | Services/CommonService/JobRunner/CustomerService.cs | 931 | C# |
using FindMaxBinaryTree;
using System;
using Trees.Classes;
using Xunit;
namespace Unit_Tests
{
public class UnitTest1
{
[Fact]
public void CanPopulateBinaryTreeWithNodes()
{
BinaryTree binTree = Program.PopulateTree();
Assert.NotNull(binTree);
}
[Fact]
public void CanFindMaxNodeValueInBinaryTree()
{
BinaryTree binTree = Program.PopulateTree();
int maxValue = binTree.Root.Value; // Root = 10
Assert.Equal(10, maxValue);
maxValue = Program.FindMax(binTree.Root, maxValue); // maxValue = 63
Assert.Equal(63, maxValue);
}
[Theory]
[InlineData(-1)]
[InlineData(5)]
[InlineData(100)]
public void CanAddNodeToBinaryTree(int inputValue)
{
Node addedNode = new Node(inputValue);
BinaryTree binTree = new BinaryTree(addedNode);
Assert.Equal(binTree.Root.Value, addedNode.Value);
}
}
}
| 23.613636 | 80 | 0.579403 | [
"MIT"
] | paulritzman/Data-Structures-and-Algorithms | Challenges/FindMaxBinaryTree/Unit-Tests/UnitTest1.cs | 1,039 | C# |
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.CosmosDB.Models
{
/// <summary>
/// Defines values for IndexingMode.
/// </summary>
public static class IndexingMode
{
public const string Consistent = "consistent";
public const string Lazy = "lazy";
public const string None = "none";
}
}
| 28.291667 | 74 | 0.687776 | [
"MIT"
] | 93mishra/azure-sdk-for-net | sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/IndexingMode.cs | 679 | C# |
namespace WowGuildManager.Services.Api
{
using System.Collections.Generic;
using WowGuildManager.Models.ApiModels.Logs;
using WowGuildManager.Models.ApiModels.Raids;
using WowGuildManager.Models.ApiModels.Characters;
public interface IApiService
{
IEnumerable<CharacterApiViewModel> GetAllMembers();
IEnumerable<CharacterApiViewModel> GetAllCharacters(string userId);
IEnumerable<ImageApiViewModel> GetAllImages();
IEnumerable<ExceptionApiViewModel> GetAllExceptions();
CharacterApiViewModel GetCharacter(string characterId);
IEnumerable<RaidDestinationProgressApiViewModel> GuildProgress();
}
}
| 32.238095 | 75 | 0.762186 | [
"MIT"
] | MomchilAngelovv/WoWGuildManager | WowGuildManager/WowGuildManager.Services/Api/IApiService.cs | 679 | C# |
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
namespace NBi.GenbiL.Action.Case
{
public class ReduceCaseAction : ICaseAction
{
public List<string> columnNames { get; set; }
public ReduceCaseAction(IEnumerable<string> variableNames)
{
this.columnNames = new List<string>(variableNames);
}
public void Execute(GenerationState state)
{
foreach (DataRow row in state.TestCaseCollection.Scope.Content.Rows)
{
foreach (var columnName in columnNames)
{
if (row[columnName] is IEnumerable<string> list)
row[columnName] = list.Distinct().ToArray();
}
}
}
public string Display
{
get
{
if (columnNames.Count == 1)
return string.Format("Reducing the length of groups for column '{0}'", columnNames[0]);
else
return string.Format("Reducing the length of groups for columns '{0}'", String.Join("', '", columnNames));
}
}
}
}
| 28.302326 | 126 | 0.542317 | [
"Apache-2.0"
] | CoolsJoris/NBi | NBi.genbiL/Action/Case/ReduceCaseAction.cs | 1,219 | C# |
using System.Collections.Generic;
using System.Threading.Tasks;
using Abp.Application.Services.Dto;
using System.Linq;
using Abp.Authorization;
using Abp.AutoMapper;
using Abp.Domain.Repositories;
using Abp.Linq.Extensions;
using System.Linq.Dynamic.Core;
using Microsoft.EntityFrameworkCore;
using HC.WeChat.BuSetInfos.Authorization;
using HC.WeChat.BuSetInfos.DomainServices;
using HC.WeChat.BuSetInfos.Dtos;
using System;
using HC.WeChat.Authorization;
namespace HC.WeChat.BuSetInfos
{
/// <summary>
/// BuSetInfo应用层服务的接口实现方法
/// </summary>
//[AbpAuthorize(BuSetInfoAppPermissions.BuSetInfo)]
[AbpAuthorize(AppPermissions.Pages)]
public class BuSetInfoAppService : WeChatAppServiceBase, IBuSetInfoAppService
{
private readonly IRepository<BuSetInfo, Guid> _busetinfoRepository;
private readonly IBuSetInfoManager _busetinfoManager;
/// <summary>
/// 构造函数
/// </summary>
public BuSetInfoAppService(
IRepository<BuSetInfo, Guid> busetinfoRepository
,IBuSetInfoManager busetinfoManager
)
{
_busetinfoRepository = busetinfoRepository;
_busetinfoManager=busetinfoManager;
}
/// <summary>
/// 获取BuSetInfo的分页列表信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PagedResultDto<BuSetInfoListDto>> GetPagedBuSetInfos(GetBuSetInfosInput input)
{
var query = _busetinfoRepository.GetAll();
// TODO:根据传入的参数添加过滤条件
var busetinfoCount = await query.CountAsync();
var busetinfos = await query
.OrderBy(input.Sorting).AsNoTracking()
.PageBy(input)
.ToListAsync();
// var busetinfoListDtos = ObjectMapper.Map<List <BuSetInfoListDto>>(busetinfos);
var busetinfoListDtos =busetinfos.MapTo<List<BuSetInfoListDto>>();
return new PagedResultDto<BuSetInfoListDto>(
busetinfoCount,
busetinfoListDtos
);
}
/// <summary>
/// 通过指定id获取BuSetInfoListDto信息
/// </summary>
public async Task<BuSetInfoListDto> GetBuSetInfoByIdAsync(EntityDto<Guid> input)
{
var entity = await _busetinfoRepository.GetAsync(input.Id);
return entity.MapTo<BuSetInfoListDto>();
}
/// <summary>
/// MPA版本才会用到的方法
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<GetBuSetInfoForEditOutput> GetBuSetInfoForEdit(NullableIdDto<Guid> input)
{
var output = new GetBuSetInfoForEditOutput();
BuSetInfoEditDto busetinfoEditDto;
if (input.Id.HasValue)
{
var entity = await _busetinfoRepository.GetAsync(input.Id.Value);
busetinfoEditDto = entity.MapTo<BuSetInfoEditDto>();
//busetinfoEditDto = ObjectMapper.Map<List <busetinfoEditDto>>(entity);
}
else
{
busetinfoEditDto = new BuSetInfoEditDto();
}
output.BuSetInfo = busetinfoEditDto;
return output;
}
/// <summary>
/// 添加或者修改BuSetInfo的公共方法
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task CreateOrUpdateBuSetInfo(CreateOrUpdateBuSetInfoInput input)
{
if (input.BuSetInfo.Id.HasValue)
{
await UpdateBuSetInfoAsync(input.BuSetInfo);
}
else
{
await CreateBuSetInfoAsync(input.BuSetInfo);
}
}
/// <summary>
/// 新增BuSetInfo
/// </summary>
[AbpAuthorize(BuSetInfoAppPermissions.BuSetInfo_CreateBuSetInfo)]
protected virtual async Task<BuSetInfoEditDto> CreateBuSetInfoAsync(BuSetInfoEditDto input)
{
//TODO:新增前的逻辑判断,是否允许新增
var entity = ObjectMapper.Map <BuSetInfo>(input);
entity = await _busetinfoRepository.InsertAsync(entity);
return entity.MapTo<BuSetInfoEditDto>();
}
/// <summary>
/// 编辑BuSetInfo
/// </summary>
[AbpAuthorize(BuSetInfoAppPermissions.BuSetInfo_EditBuSetInfo)]
protected virtual async Task UpdateBuSetInfoAsync(BuSetInfoEditDto input)
{
//TODO:更新前的逻辑判断,是否允许更新
var entity = await _busetinfoRepository.GetAsync(input.Id.Value);
input.MapTo(entity);
// ObjectMapper.Map(input, entity);
await _busetinfoRepository.UpdateAsync(entity);
}
/// <summary>
/// 删除BuSetInfo信息的方法
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[AbpAuthorize(BuSetInfoAppPermissions.BuSetInfo_DeleteBuSetInfo)]
public async Task DeleteBuSetInfo(EntityDto<Guid> input)
{
//TODO:删除前的逻辑判断,是否允许删除
await _busetinfoRepository.DeleteAsync(input.Id);
}
/// <summary>
/// 批量删除BuSetInfo的方法
/// </summary>
[AbpAuthorize(BuSetInfoAppPermissions.BuSetInfo_BatchDeleteBuSetInfos)]
public async Task BatchDeleteBuSetInfosAsync(List<Guid> input)
{
//TODO:批量删除前的逻辑判断,是否允许删除
await _busetinfoRepository.DeleteAsync(s => input.Contains(s.Id));
}
/// <summary>
/// 导出BuSetInfo为excel表
/// </summary>
/// <returns></returns>
//public async Task<FileDto> GetBuSetInfosToExcel()
//{
// var users = await UserManager.Users.ToListAsync();
// var userListDtos = ObjectMapper.Map<List<UserListDto>>(users);
// await FillRoleNames(userListDtos);
// return _userListExcelExporter.ExportToFile(userListDtos);
//}
//// custom codes
//// custom codes end
}
}
| 24.961353 | 100 | 0.704858 | [
"MIT"
] | DonaldTdz/syq | aspnet-core/src/HC.WeChat.Application/BuSetInfos/BuSetInfoAppService.cs | 5,467 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
namespace JyFramework
{
public class ObjectModule : BaseModule
{
public ObjectModule(EventController ec, string name = "ObjectModule") : base(ec, name)
{
}
protected override void OnStart(params object[] parms)
{
Debug.Log("ObjectModule OnStart");
}
protected override void OnPause(params object[] parms)
{
Debug.Log("ObjectModule OnPause");
}
protected override void OnExit(params object[] parms)
{
Debug.Log("ObjectModule OnExit");
}
}
}
| 23.354839 | 95 | 0.58011 | [
"MIT"
] | John-Chen-90/JyGame | Assets/FrameworkCore/Modules/Object/ObjectModule.cs | 726 | C# |
// This file is auto-generated, don't edit it. Thanks.
using System;
using System.Collections.Generic;
using System.IO;
using Tea;
namespace AntChain.SDK.RISKPLUS.Models
{
public class PullRegtechNewsRequest : TeaModel {
// OAuth模式下的授权token
[NameInMap("auth_token")]
[Validation(Required=false)]
public string AuthToken { get; set; }
[NameInMap("product_instance_id")]
[Validation(Required=false)]
public string ProductInstanceId { get; set; }
// 表示本地数据库中舆情数据中的最大id
[NameInMap("news_max_id")]
[Validation(Required=true)]
public string NewsMaxId { get; set; }
}
}
| 22.965517 | 54 | 0.65015 | [
"MIT"
] | alipay/antchain-openapi-prod-sdk | riskplus/csharp/core/Models/PullRegtechNewsRequest.cs | 710 | C# |
using System;
using Amazon.Runtime.Internal;
namespace AWSXRay.SQS.Publisher.Extensions
{
// ReSharper disable once InconsistentNaming
internal class SQSXRayPipelineCustomizer : IRuntimePipelineCustomizer
{
public string UniqueName => typeof(SQSXRayPipelineCustomizer).FullName;
public void Customize(Type serviceClientType, RuntimePipeline pipeline)
{
pipeline.AddHandlerAfter<EndpointResolver>(new SQSXRayPipelineHandler());
}
}
} | 32 | 86 | 0.712891 | [
"MIT"
] | waxtell/AWSXRay.SQS.Publisher.Extensions | AWSXRay.SQS.Publisher.Extensions/SQSXRayPipelineCustomizer.cs | 514 | C# |
using System.Text.Json.Serialization;
using Essensoft.Paylink.Alipay.Domain;
namespace Essensoft.Paylink.Alipay.Response
{
/// <summary>
/// AlipayDataDataserviceAdCreativeQueryResponse.
/// </summary>
public class AlipayDataDataserviceAdCreativeQueryResponse : AlipayResponse
{
/// <summary>
/// 创意详情
/// </summary>
[JsonPropertyName("creative_detail")]
public CreativeDetail CreativeDetail { get; set; }
}
}
| 26.444444 | 78 | 0.672269 | [
"MIT"
] | Frunck8206/payment | src/Essensoft.Paylink.Alipay/Response/AlipayDataDataserviceAdCreativeQueryResponse.cs | 486 | C# |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Aws.Ec2.Inputs
{
public sealed class InstanceEnclaveOptionsArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Whether Nitro Enclaves will be enabled on the instance. Defaults to `false`.
/// </summary>
[Input("enabled")]
public Input<bool>? Enabled { get; set; }
public InstanceEnclaveOptionsArgs()
{
}
}
}
| 27.423077 | 88 | 0.661992 | [
"ECL-2.0",
"Apache-2.0"
] | RafalSumislawski/pulumi-aws | sdk/dotnet/Ec2/Inputs/InstanceEnclaveOptionsArgs.cs | 713 | C# |
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using AspnetRunBasics.Extensions;
using AspnetRunBasics.Models;
namespace AspnetRunBasics.Services
{
public class OrderService : IOrderService
{
private readonly HttpClient _client;
public OrderService(HttpClient client)
{
_client = client ?? throw new ArgumentNullException(nameof(client));
}
public async Task<IEnumerable<OrderResponseModel>> GetOrdersByUserName(string userName)
{
var response = await _client.GetAsync($"/Order/{userName}");
return await response.ReadContentAs<List<OrderResponseModel>>();
}
}
} | 29 | 95 | 0.692414 | [
"MIT"
] | haristauqir/AspnetMicroservices | src/WebApps/AspnetRunBasics/Services/OrderService.cs | 725 | C# |
using Handelabra.Sentinels.Engine.Controller;
using Handelabra.Sentinels.Engine.Model;
using System;
using System.Collections;
namespace Cauldron.Cricket
{
public class GrasshopperKickCardController : CardController
{
public GrasshopperKickCardController(Card card, TurnTakerController turnTakerController) : base(card, turnTakerController)
{
}
public override IEnumerator UsePower(int index = 0)
{
int targetNumeral = GetPowerNumeral(0, 1);
int damageNumeral = GetPowerNumeral(1, 2);
//{Cricket} deals 1 target 2 melee damage.
IEnumerator coroutine = base.GameController.SelectTargetsAndDealDamage(base.HeroTurnTakerController, new DamageSource(base.GameController, base.CharacterCard), damageNumeral, DamageType.Melee, targetNumeral, false, targetNumeral, cardSource: base.GetCardSource());
if (base.UseUnityCoroutines)
{
yield return base.GameController.StartCoroutine(coroutine);
}
else
{
base.GameController.ExhaustCoroutine(coroutine);
}
//{Cricket} is immune to damage dealt by environment targets until the start of your next turn.
OnDealDamageStatusEffect immuneToDamageStatusEffect = new OnDealDamageStatusEffect(CardWithoutReplacements,
nameof(ImmuneToEnvironmentDamageEffect),
$"{CharacterCard.Title} is immune to damage from environment targets.",
new TriggerType[] { TriggerType.ImmuneToDamage },
DecisionMaker.TurnTaker,
this.Card);
//{Cricket}...
immuneToDamageStatusEffect.TargetCriteria.IsSpecificCard = base.CharacterCard;
//...is immune to damage dealt by environment targets...
immuneToDamageStatusEffect.SourceCriteria.IsTarget = true;
//...until the start of your next turn.
immuneToDamageStatusEffect.UntilStartOfNextTurn(base.TurnTaker);
immuneToDamageStatusEffect.TargetLeavesPlayExpiryCriteria.Card = base.CharacterCard;
coroutine = base.AddStatusEffect(immuneToDamageStatusEffect, true);
if (base.UseUnityCoroutines)
{
yield return base.GameController.StartCoroutine(coroutine);
}
else
{
base.GameController.ExhaustCoroutine(coroutine);
}
yield break;
}
public IEnumerator ImmuneToEnvironmentDamageEffect(DealDamageAction dd, TurnTaker hero, StatusEffect effect, int[] powerNumerals = null)
{
IEnumerator coroutine;
if(dd.DamageSource.IsEnvironmentTarget)
{
coroutine = CancelAction(dd, isPreventEffect: true);
}
else
{
coroutine = DoNothing();
}
if (base.UseUnityCoroutines)
{
yield return base.GameController.StartCoroutine(coroutine);
}
else
{
base.GameController.ExhaustCoroutine(coroutine);
}
yield break;
}
}
} | 45.576923 | 276 | 0.566526 | [
"MIT"
] | SotMSteamMods/CauldronMods | CauldronMods/Controller/Heroes/Cricket/Cards/GrasshopperKickCardController.cs | 3,557 | C# |
using System.Collections.Generic;
namespace VoteMonitor.Entities
{
public partial class City
{
public City()
{
PollingStations = new HashSet<PollingStation>();
}
public int Id { get; set; }
public string Name { get; set; }
public virtual ICollection<PollingStation> PollingStations { get; set; }
}
}
| 20.888889 | 80 | 0.601064 | [
"MPL-2.0"
] | EmaSujova/monitorizare-vot | src/api/VoteMonitor.Entities/City.cs | 378 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.