repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-net | aws | C# | /*
* Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
using System;
using System.Collections;
namespace ThirdParty.BouncyCastle.Utilities.IO.Pem
{
public class PemObject
: PemObjectGenerator
{
private string type;
private IList headers;
private byte[] content;
public PemObject(string type, byte[] content)
: this(type, Platform.CreateArrayList(), content)
{
}
public PemObject(String type, IList headers, byte[] content)
{
this.type = type;
this.headers = Platform.CreateArrayList(headers);
this.content = content;
}
public string Type
{
get { return type; }
}
public IList Headers
{
get { return headers; }
}
public byte[] Content
{
get { return content; }
}
public PemObject Generate()
{
return this;
}
}
}
| 69 |
aws-sdk-net | aws | C# | /*
* Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
using System;
namespace ThirdParty.BouncyCastle.Utilities.IO.Pem
{
public interface PemObjectGenerator
{
/// <returns>
/// A <see cref="PemObject"/>
/// </returns>
/// <exception cref="PemGenerationException"></exception>
PemObject Generate();
}
}
| 35 |
aws-sdk-net | aws | C# | /*
* Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
using System;
using System.IO;
namespace ThirdParty.BouncyCastle.Utilities.IO.Pem
{
public interface PemObjectParser
{
/// <param name="obj">
/// A <see cref="PemObject"/>
/// </param>
/// <returns>
/// A <see cref="System.Object"/>
/// </returns>
/// <exception cref="IOException"></exception>
object ParseObject(PemObject obj);
}
}
| 39 |
aws-sdk-net | aws | C# | /*
* Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
* FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
using System;
using System.Collections;
using System.IO;
using System.Text;
namespace ThirdParty.BouncyCastle.Utilities.IO.Pem
{
public class PemReader
{
private const string BeginString = "-----BEGIN ";
private const string EndString = "-----END ";
private readonly TextReader reader;
public PemReader(TextReader reader)
{
if (reader == null)
throw new ArgumentNullException("reader");
this.reader = reader;
}
public TextReader Reader
{
get { return reader; }
}
/// <returns>
/// A <see cref="PemObject"/>
/// </returns>
/// <exception cref="IOException"></exception>
public PemObject ReadPemObject()
{
string line = reader.ReadLine();
if (line != null && line.StartsWith(BeginString))
{
line = line.Substring(BeginString.Length);
int index = line.IndexOf('-');
string type = line.Substring(0, index);
if (index > 0)
return LoadObject(type);
}
return null;
}
private PemObject LoadObject(string type)
{
string endMarker = EndString + type;
IList headers = Platform.CreateArrayList();
StringBuilder buf = new StringBuilder();
string line;
while ((line = reader.ReadLine()) != null
&& line.IndexOf(endMarker) == -1)
{
int colonPos = line.IndexOf(':');
if (colonPos == -1)
{
buf.Append(line.Trim());
}
else
{
// Process field
string fieldName = line.Substring(0, colonPos).Trim();
if (fieldName.StartsWith("X-"))
fieldName = fieldName.Substring(2);
string fieldValue = line.Substring(colonPos + 1).Trim();
headers.Add(new PemHeader(fieldName, fieldValue));
}
}
if (line == null)
{
throw new IOException(endMarker + " not found");
}
if (buf.Length % 4 != 0)
{
throw new IOException("base64 data appears to be truncated");
}
return new PemObject(type, headers, Convert.FromBase64String(buf.ToString()));
}
}
}
| 114 |
aws-sdk-net | aws | C# | //
// Copyright (c) 2006-2009 Microsoft Corporation. All rights reserved.
//
//
// Implements the CRC algorithm, which is used in zip files. The zip format calls for
// the zipfile to contain a CRC for the unencrypted byte stream of each file.
//
// It is based on example source code published at
// http://www.vbaccelerator.com/home/net/code/libraries/CRC32/Crc32_zip_CRC32_CRC32_cs.asp
//
// This implementation adds a tweak of that code for use within zip creation. While
// computing the CRC we also compress the byte stream, in the same read loop. This
// avoids the need to read through the uncompressed stream twice - once to compute CRC
// and another time to compress.
//
// Thu, 30 Mar 2006 13:58
//
using System;
namespace ThirdParty.Ionic.Zlib
{
/// <summary>
/// Calculates a 32bit Cyclic Redundancy Checksum (CRC) using the
/// same polynomial used by Zip. This type is used internally by DotNetZip; it is generally not used directly
/// by applications wishing to create, read, or manipulate zip archive files.
/// </summary>
internal class CRC32
{
/// <summary>
/// indicates the total number of bytes read on the CRC stream.
/// This is used when writing the ZipDirEntry when compressing files.
/// </summary>
public Int64 TotalBytesRead
{
get
{
return _TotalBytesRead;
}
}
/// <summary>
/// Indicates the current CRC for all blocks slurped in.
/// </summary>
public Int32 Crc32Result
{
get
{
// return one's complement of the running result
return unchecked((Int32)(~_RunningCrc32Result));
}
}
/// <summary>
/// Returns the CRC32 for the specified stream.
/// </summary>
/// <param name="input">The stream over which to calculate the CRC32</param>
/// <returns>the CRC32 calculation</returns>
public Int32 GetCrc32(System.IO.Stream input)
{
return GetCrc32AndCopy(input, null);
}
/// <summary>
/// Returns the CRC32 for the specified stream, and writes the input into the output stream.
/// </summary>
/// <param name="input">The stream over which to calculate the CRC32</param>
/// <param name="output">The stream into which to deflate the input</param>
/// <returns>the CRC32 calculation</returns>
public Int32 GetCrc32AndCopy(System.IO.Stream input, System.IO.Stream output)
{
unchecked
{
//UInt32 crc32Result;
//crc32Result = 0xFFFFFFFF;
byte[] buffer = new byte[BUFFER_SIZE];
int readSize = BUFFER_SIZE;
_TotalBytesRead = 0;
int count = input.Read(buffer, 0, readSize);
if (output != null) output.Write(buffer, 0, count);
_TotalBytesRead += count;
while (count > 0)
{
//for (int i = 0; i < count; i++)
//{
// _RunningCrc32Result = ((_RunningCrc32Result) >> 8) ^ crc32Table[(buffer[i]) ^ ((_RunningCrc32Result) & 0x000000FF)];
//}
SlurpBlock(buffer, 0, count);
count = input.Read(buffer, 0, readSize);
if (output != null) output.Write(buffer, 0, count);
_TotalBytesRead += count;
}
return (Int32)(~_RunningCrc32Result);
}
}
/// <summary>
/// Get the CRC32 for the given (word,byte) combo.
/// This is a computation defined by PKzip.
/// </summary>
/// <param name="W">The word to start with.</param>
/// <param name="B">The byte to combine it with.</param>
/// <returns>The CRC-ized result.</returns>
public Int32 ComputeCrc32(Int32 W, byte B)
{
return _InternalComputeCrc32((UInt32)W, B);
}
internal Int32 _InternalComputeCrc32(UInt32 W, byte B)
{
return (Int32)(crc32Table[(W ^ B) & 0xFF] ^ (W >> 8));
}
/// <summary>
/// Update the value for the running CRC32 using the given block of bytes.
/// This is useful when using the CRC32() class in a Stream.
/// </summary>
/// <param name="block">block of bytes to slurp</param>
/// <param name="offset">starting point in the block</param>
/// <param name="count">how many bytes within the block to slurp</param>
public void SlurpBlock(byte[] block, int offset, int count)
{
for (int i = 0; i < count; i++)
{
int x = offset + i;
_RunningCrc32Result = ((_RunningCrc32Result) >> 8) ^ crc32Table[(block[x]) ^ ((_RunningCrc32Result) & 0x000000FF)];
}
_TotalBytesRead += count;
}
// pre-initialize the crc table for speed of lookup.
static CRC32()
{
unchecked
{
// This is the official polynomial used by CRC32 in PKZip.
// Often the polynomial is shown reversed as 0x04C11DB7.
UInt32 dwPolynomial = 0xEDB88320;
UInt32 i, j;
crc32Table = new UInt32[256];
UInt32 dwCrc;
for (i = 0; i < 256; i++)
{
dwCrc = i;
for (j = 8; j > 0; j--)
{
if ((dwCrc & 1) == 1)
{
dwCrc = (dwCrc >> 1) ^ dwPolynomial;
}
else
{
dwCrc >>= 1;
}
}
crc32Table[i] = dwCrc;
}
}
}
// private member vars
private Int64 _TotalBytesRead;
private static UInt32[] crc32Table;
private const int BUFFER_SIZE = 8192;
private UInt32 _RunningCrc32Result = 0xFFFFFFFF;
}
/// <summary>
/// A Stream that calculates a CRC32 (a checksum) on all bytes read,
/// or on all bytes written.
/// </summary>
///
/// <remarks>
/// <para>
/// This class can be used to verify the CRC of a ZipEntry when reading from a stream,
/// or to calculate a CRC when writing to a stream. The stream should be used to either
/// read, or write, but not both. If you intermix reads and writes, the results are
/// not defined.
/// </para>
/// <para>This class is intended primarily for use internally by the DotNetZip library.</para>
/// </remarks>
public class CrcCalculatorStream : System.IO.Stream
{
private System.IO.Stream _InnerStream;
private CRC32 _Crc32;
private Int64 _length = 0;
/// <summary>
/// Gets the total number of bytes run through the CRC32 calculator.
/// </summary>
///
/// <remarks>
/// This is either the total number of bytes read, or the total number
/// of bytes written, depending on the direction of this stream.
/// </remarks>
public Int64 TotalBytesSlurped
{
get { return _Crc32.TotalBytesRead; }
}
/// <summary>
/// The constructor.
/// </summary>
/// <param name="stream">The underlying stream</param>
public CrcCalculatorStream(System.IO.Stream stream)
: base()
{
_InnerStream = stream;
_Crc32 = new CRC32();
}
/// <summary>
/// The constructor.
/// </summary>
/// <param name="stream">The underlying stream</param>
/// <param name="length">The length of the stream to slurp</param>
public CrcCalculatorStream(System.IO.Stream stream, Int64 length)
: base()
{
_InnerStream = stream;
_Crc32 = new CRC32();
_length = length;
}
/// <summary>
/// Provides the current CRC for all blocks slurped in.
/// </summary>
public Int32 Crc32
{
get { return _Crc32.Crc32Result; }
}
/// <summary>
/// Read from the stream
/// </summary>
/// <param name="buffer">the buffer to read</param>
/// <param name="offset">the offset at which to start</param>
/// <param name="count">the number of bytes to read</param>
/// <returns>the number of bytes actually read</returns>
public override int Read(byte[] buffer, int offset, int count)
{
int bytesToRead = count;
// Need to limit the # of bytes returned, if the stream is intended to have a definite length.
// This is especially useful when returning a stream for the uncompressed data directly to the
// application. The app won't necessarily read only the UncompressedSize number of bytes.
// For example wrapping the stream returned from OpenReader() into a StreadReader() and
// calling ReadToEnd() on it, We can "over-read" the zip data and get a corrupt string.
// The length limits that, prevents that problem.
if (_length != 0)
{
if (_Crc32.TotalBytesRead >= _length) return 0; // EOF
Int64 bytesRemaining = _length - _Crc32.TotalBytesRead;
if (bytesRemaining < count) bytesToRead = (int)bytesRemaining;
}
int n = _InnerStream.Read(buffer, offset, bytesToRead);
if (n > 0) _Crc32.SlurpBlock(buffer, offset, n);
return n;
}
/// <summary>
/// Write to the stream.
/// </summary>
/// <param name="buffer">the buffer from which to write</param>
/// <param name="offset">the offset at which to start writing</param>
/// <param name="count">the number of bytes to write</param>
public override void Write(byte[] buffer, int offset, int count)
{
if (count > 0) _Crc32.SlurpBlock(buffer, offset, count);
_InnerStream.Write(buffer, offset, count);
}
/// <summary>
/// Indicates whether the stream supports reading.
/// </summary>
public override bool CanRead
{
get { return _InnerStream.CanRead; }
}
/// <summary>
/// Indicates whether the stream supports seeking.
/// </summary>
public override bool CanSeek
{
get { return _InnerStream.CanSeek; }
}
/// <summary>
/// Indicates whether the stream supports writing.
/// </summary>
public override bool CanWrite
{
get { return _InnerStream.CanWrite; }
}
/// <summary>
/// Flush the stream.
/// </summary>
public override void Flush()
{
_InnerStream.Flush();
}
/// <summary>
/// Not implemented.
/// </summary>
public override long Length
{
get
{
if (_length == 0) throw new NotImplementedException();
else return _length;
}
}
/// <summary>
/// Not implemented.
/// </summary>
public override long Position
{
get { return _Crc32.TotalBytesRead; }
set { throw new NotImplementedException(); }
}
/// <summary>
/// Not implemented.
/// </summary>
/// <param name="offset">N/A</param>
/// <param name="origin">N/A</param>
/// <returns>N/A</returns>
public override long Seek(long offset, System.IO.SeekOrigin origin)
{
throw new NotImplementedException();
}
/// <summary>
/// Not implemented.
/// </summary>
/// <param name="value">N/A</param>
public override void SetLength(long value)
{
throw new NotImplementedException();
}
}
} | 363 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// IJsonWrapper.cs
/// Interface that represents a type capable of handling all kinds of JSON
/// data. This is mainly used when mapping objects through JsonMapper, and
/// it's implemented by JsonData.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System.Collections;
using System.Collections.Specialized;
namespace ThirdParty.Json.LitJson
{
public enum JsonType
{
None,
Object,
Array,
String,
Int,
UInt,
Long,
ULong,
Double,
Boolean
}
public interface IJsonWrapper : IList, IOrderedDictionary
{
bool IsArray { get; }
bool IsBoolean { get; }
bool IsDouble { get; }
bool IsInt { get; }
bool IsUInt { get; }
bool IsLong { get; }
bool IsULong { get; }
bool IsObject { get; }
bool IsString { get; }
bool GetBoolean ();
double GetDouble ();
int GetInt ();
uint GetUInt();
JsonType GetJsonType ();
long GetLong ();
ulong GetULong();
string GetString ();
void SetBoolean (bool val);
void SetDouble (double val);
void SetInt (int val);
void SetUInt (uint val);
void SetJsonType (JsonType type);
void SetLong (long val);
void SetULong (ulong val);
void SetString (string val);
string ToJson ();
void ToJson (JsonWriter writer);
}
}
| 69 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonData.cs
/// Generic type to hold JSON data (objects, arrays, and so on). This is
/// the default type returned by JsonMapper.ToObject().
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
namespace ThirdParty.Json.LitJson
{
public class JsonData : IJsonWrapper, IEquatable<JsonData>
{
#region Fields
private IList<JsonData> inst_array;
private bool inst_boolean;
private double inst_double;
// number datatype that holds int, uint, long, and ulong values.
// type field keeps track of the actual type of the value
// and casted before returning the value to the client code.
private ulong inst_number;
private IDictionary<string, JsonData> inst_object;
private string inst_string;
private string json;
private JsonType type;
// Used to implement the IOrderedDictionary interface
private IList<KeyValuePair<string, JsonData>> object_list;
#endregion
#region Properties
public int Count {
get { return EnsureCollection ().Count; }
}
public bool IsArray {
get { return type == JsonType.Array; }
}
public bool IsBoolean {
get { return type == JsonType.Boolean; }
}
public bool IsDouble {
get { return type == JsonType.Double; }
}
public bool IsInt {
get { return type == JsonType.Int; }
}
public bool IsUInt {
get { return type == JsonType.UInt; }
}
public bool IsLong {
get { return type == JsonType.Long; }
}
public bool IsULong {
get { return type == JsonType.ULong; }
}
public bool IsObject {
get { return type == JsonType.Object; }
}
public bool IsString {
get { return type == JsonType.String; }
}
#endregion
#region ICollection Properties
int ICollection.Count {
get {
return Count;
}
}
bool ICollection.IsSynchronized {
get {
return EnsureCollection ().IsSynchronized;
}
}
object ICollection.SyncRoot {
get {
return EnsureCollection ().SyncRoot;
}
}
#endregion
#region IDictionary Properties
bool IDictionary.IsFixedSize {
get {
return EnsureDictionary ().IsFixedSize;
}
}
bool IDictionary.IsReadOnly {
get {
return EnsureDictionary ().IsReadOnly;
}
}
ICollection IDictionary.Keys {
get {
EnsureDictionary ();
IList<string> keys = new List<string> ();
foreach (KeyValuePair<string, JsonData> entry in
object_list) {
keys.Add (entry.Key);
}
return (ICollection) keys;
}
}
ICollection IDictionary.Values {
get {
EnsureDictionary ();
IList<JsonData> values = new List<JsonData> ();
foreach (KeyValuePair<string, JsonData> entry in
object_list) {
values.Add (entry.Value);
}
return (ICollection) values;
}
}
#endregion
#region IJsonWrapper Properties
bool IJsonWrapper.IsArray {
get { return IsArray; }
}
bool IJsonWrapper.IsBoolean {
get { return IsBoolean; }
}
bool IJsonWrapper.IsDouble {
get { return IsDouble; }
}
bool IJsonWrapper.IsInt {
get { return IsInt; }
}
bool IJsonWrapper.IsLong {
get { return IsLong; }
}
bool IJsonWrapper.IsObject {
get { return IsObject; }
}
bool IJsonWrapper.IsString {
get { return IsString; }
}
#endregion
#region IList Properties
bool IList.IsFixedSize {
get {
return EnsureList ().IsFixedSize;
}
}
bool IList.IsReadOnly {
get {
return EnsureList ().IsReadOnly;
}
}
#endregion
#region IDictionary Indexer
object IDictionary.this[object key] {
get {
return EnsureDictionary ()[key];
}
set {
if (! (key is String))
throw new ArgumentException (
"The key has to be a string");
JsonData data = ToJsonData (value);
this[(string) key] = data;
}
}
#endregion
#region IOrderedDictionary Indexer
object IOrderedDictionary.this[int idx] {
get {
EnsureDictionary ();
return object_list[idx].Value;
}
set {
EnsureDictionary ();
JsonData data = ToJsonData (value);
KeyValuePair<string, JsonData> old_entry = object_list[idx];
inst_object[old_entry.Key] = data;
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (old_entry.Key, data);
object_list[idx] = entry;
}
}
#endregion
#region IList Indexer
object IList.this[int index] {
get {
return EnsureList ()[index];
}
set {
EnsureList ();
JsonData data = ToJsonData (value);
this[index] = data;
}
}
#endregion
#region Public Indexers
public IEnumerable<string> PropertyNames
{
get
{
EnsureDictionary();
return inst_object.Keys;
}
}
public JsonData this[string prop_name] {
get {
EnsureDictionary ();
JsonData data = null;
inst_object.TryGetValue(prop_name, out data);
return data;
}
set {
EnsureDictionary ();
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (prop_name, value);
if (inst_object.ContainsKey (prop_name)) {
for (int i = 0; i < object_list.Count; i++) {
if (object_list[i].Key == prop_name) {
object_list[i] = entry;
break;
}
}
} else
object_list.Add (entry);
inst_object[prop_name] = value;
json = null;
}
}
public JsonData this[int index] {
get {
EnsureCollection ();
if (type == JsonType.Array)
return inst_array[index];
return object_list[index].Value;
}
set {
EnsureCollection ();
if (type == JsonType.Array)
inst_array[index] = value;
else {
KeyValuePair<string, JsonData> entry = object_list[index];
KeyValuePair<string, JsonData> new_entry =
new KeyValuePair<string, JsonData> (entry.Key, value);
object_list[index] = new_entry;
inst_object[entry.Key] = value;
}
json = null;
}
}
#endregion
#region Constructors
public JsonData ()
{
}
public JsonData (bool boolean)
{
type = JsonType.Boolean;
inst_boolean = boolean;
}
public JsonData (double number)
{
type = JsonType.Double;
inst_double = number;
}
public JsonData (int number)
{
type = JsonType.Int;
inst_number = (ulong)number;
}
public JsonData(uint number)
{
type = JsonType.UInt;
inst_number = (ulong)number;
}
public JsonData (long number)
{
type = JsonType.Long;
inst_number = (ulong)number;
}
public JsonData(ulong number)
{
type = JsonType.ULong;
inst_number = number;
}
public JsonData (object obj)
{
if (obj is Boolean) {
type = JsonType.Boolean;
inst_boolean = (bool) obj;
return;
}
if (obj is Double) {
type = JsonType.Double;
inst_double = (double) obj;
return;
}
if (obj is Int32) {
type = JsonType.Int;
inst_number = (ulong)obj;
return;
}
if (obj is UInt32)
{
type = JsonType.UInt;
inst_number = (ulong)obj;
return;
}
if (obj is Int64) {
type = JsonType.Long;
inst_number = (ulong)obj;
return;
}
if (obj is UInt64)
{
type = JsonType.ULong;
inst_number = (ulong)obj;
return;
}
if (obj is String) {
type = JsonType.String;
inst_string = (string) obj;
return;
}
throw new ArgumentException (
"Unable to wrap the given object with JsonData");
}
public JsonData (string str)
{
type = JsonType.String;
inst_string = str;
}
#endregion
#region Implicit Conversions
public static implicit operator JsonData (Boolean data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Double data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int32 data)
{
return new JsonData (data);
}
public static implicit operator JsonData (Int64 data)
{
return new JsonData (data);
}
public static implicit operator JsonData (String data)
{
return new JsonData (data);
}
#endregion
#region Explicit Conversions
public static explicit operator Boolean (JsonData data)
{
if (data.type != JsonType.Boolean)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a double");
return data.inst_boolean;
}
public static explicit operator Double (JsonData data)
{
if (data.type != JsonType.Double)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a double");
return data.inst_double;
}
public static explicit operator Int32 (JsonData data)
{
if (data.type != JsonType.Int)
{
throw new InvalidCastException (
"Instance of JsonData doesn't hold an int");
}
return unchecked((int)data.inst_number);
}
public static explicit operator UInt32(JsonData data)
{
if (data.type != JsonType.UInt)
{
throw new InvalidCastException(
"Instance of JsonData doesn't hold an int");
}
return unchecked((uint)data.inst_number);
}
public static explicit operator Int64 (JsonData data)
{
if (data.type != JsonType.Int && data.type != JsonType.Long)
{
throw new InvalidCastException (
"Instance of JsonData doesn't hold an long");
}
return unchecked((long)data.inst_number);
}
[CLSCompliant(false)]
public static explicit operator UInt64(JsonData data)
{
if (data.type != JsonType.UInt && data.type != JsonType.ULong)
{
throw new InvalidCastException(
"Instance of JsonData doesn't hold an long");
}
return (ulong)data.inst_number;
}
public static explicit operator String (JsonData data)
{
if (data.type != JsonType.String)
throw new InvalidCastException (
"Instance of JsonData doesn't hold a string");
return data.inst_string;
}
#endregion
#region ICollection Methods
void ICollection.CopyTo (Array array, int index)
{
EnsureCollection ().CopyTo (array, index);
}
#endregion
#region IDictionary Methods
void IDictionary.Add (object key, object value)
{
JsonData data = ToJsonData (value);
EnsureDictionary ().Add (key, data);
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> ((string) key, data);
object_list.Add (entry);
json = null;
}
void IDictionary.Clear ()
{
EnsureDictionary ().Clear ();
object_list.Clear ();
json = null;
}
bool IDictionary.Contains (object key)
{
return EnsureDictionary ().Contains (key);
}
IDictionaryEnumerator IDictionary.GetEnumerator ()
{
return ((IOrderedDictionary) this).GetEnumerator ();
}
void IDictionary.Remove (object key)
{
EnsureDictionary ().Remove (key);
for (int i = 0; i < object_list.Count; i++) {
if (object_list[i].Key == (string) key) {
object_list.RemoveAt (i);
break;
}
}
json = null;
}
#endregion
#region IEnumerable Methods
IEnumerator IEnumerable.GetEnumerator ()
{
return EnsureCollection ().GetEnumerator ();
}
#endregion
#region IJsonWrapper Methods
bool IJsonWrapper.GetBoolean ()
{
if (type != JsonType.Boolean)
throw new InvalidOperationException (
"JsonData instance doesn't hold a boolean");
return inst_boolean;
}
double IJsonWrapper.GetDouble ()
{
if (type != JsonType.Double)
throw new InvalidOperationException (
"JsonData instance doesn't hold a double");
return inst_double;
}
int IJsonWrapper.GetInt ()
{
if (type != JsonType.Int)
throw new InvalidOperationException (
"JsonData instance doesn't hold an int");
return unchecked((int)inst_number);
}
uint IJsonWrapper.GetUInt()
{
if (type != JsonType.UInt)
throw new InvalidOperationException(
"JsonData instance doesn't hold an int");
return unchecked((uint)inst_number);
}
long IJsonWrapper.GetLong ()
{
if (type != JsonType.Long)
throw new InvalidOperationException (
"JsonData instance doesn't hold a long");
return unchecked((long)inst_number);
}
ulong IJsonWrapper.GetULong()
{
if (type != JsonType.ULong)
throw new InvalidOperationException(
"JsonData instance doesn't hold a long");
return inst_number;
}
string IJsonWrapper.GetString ()
{
if (type != JsonType.String)
throw new InvalidOperationException (
"JsonData instance doesn't hold a string");
return inst_string;
}
void IJsonWrapper.SetBoolean (bool val)
{
type = JsonType.Boolean;
inst_boolean = val;
json = null;
}
void IJsonWrapper.SetDouble (double val)
{
type = JsonType.Double;
inst_double = val;
json = null;
}
void IJsonWrapper.SetInt (int val)
{
type = JsonType.Int;
inst_number = unchecked((ulong)val);
json = null;
}
void IJsonWrapper.SetUInt(uint val)
{
type = JsonType.UInt;
inst_number = unchecked((ulong)val);
json = null;
}
void IJsonWrapper.SetLong (long val)
{
type = JsonType.Long;
inst_number = unchecked((ulong)val);
json = null;
}
void IJsonWrapper.SetULong(ulong val)
{
type = JsonType.ULong;
inst_number = val;
json = null;
}
void IJsonWrapper.SetString (string val)
{
type = JsonType.String;
inst_string = val;
json = null;
}
string IJsonWrapper.ToJson ()
{
return ToJson ();
}
void IJsonWrapper.ToJson (JsonWriter writer)
{
ToJson (writer);
}
#endregion
#region IList Methods
int IList.Add (object value)
{
return Add (value);
}
void IList.Clear ()
{
EnsureList ().Clear ();
json = null;
}
bool IList.Contains (object value)
{
return EnsureList ().Contains (value);
}
int IList.IndexOf (object value)
{
return EnsureList ().IndexOf (value);
}
void IList.Insert (int index, object value)
{
EnsureList ().Insert (index, value);
json = null;
}
void IList.Remove (object value)
{
EnsureList ().Remove (value);
json = null;
}
void IList.RemoveAt (int index)
{
EnsureList ().RemoveAt (index);
json = null;
}
#endregion
#region IOrderedDictionary Methods
IDictionaryEnumerator IOrderedDictionary.GetEnumerator ()
{
EnsureDictionary ();
return new OrderedDictionaryEnumerator (
object_list.GetEnumerator ());
}
void IOrderedDictionary.Insert (int idx, object key, object value)
{
string property = (string) key;
JsonData data = ToJsonData (value);
this[property] = data;
KeyValuePair<string, JsonData> entry =
new KeyValuePair<string, JsonData> (property, data);
object_list.Insert (idx, entry);
}
void IOrderedDictionary.RemoveAt (int idx)
{
EnsureDictionary ();
inst_object.Remove (object_list[idx].Key);
object_list.RemoveAt (idx);
}
#endregion
#region Private Methods
private ICollection EnsureCollection ()
{
if (type == JsonType.Array)
return (ICollection) inst_array;
if (type == JsonType.Object)
return (ICollection) inst_object;
throw new InvalidOperationException (
"The JsonData instance has to be initialized first");
}
private IDictionary EnsureDictionary ()
{
if (type == JsonType.Object)
return (IDictionary) inst_object;
if (type != JsonType.None)
throw new InvalidOperationException (
"Instance of JsonData is not a dictionary");
type = JsonType.Object;
inst_object = new Dictionary<string, JsonData> ();
object_list = new List<KeyValuePair<string, JsonData>> ();
return (IDictionary) inst_object;
}
private IList EnsureList ()
{
if (type == JsonType.Array)
return (IList) inst_array;
if (type != JsonType.None)
throw new InvalidOperationException (
"Instance of JsonData is not a list");
type = JsonType.Array;
inst_array = new List<JsonData> ();
return (IList) inst_array;
}
private JsonData ToJsonData (object obj)
{
if (obj == null)
return null;
if (obj is JsonData)
return (JsonData) obj;
return new JsonData (obj);
}
private static void WriteJson (IJsonWrapper obj, JsonWriter writer)
{
if (obj == null) {
writer.Write(null);
return;
}
if (obj.IsString) {
writer.Write (obj.GetString ());
return;
}
if (obj.IsBoolean) {
writer.Write (obj.GetBoolean ());
return;
}
if (obj.IsDouble) {
writer.Write (obj.GetDouble ());
return;
}
if (obj.IsInt) {
writer.Write (obj.GetInt ());
return;
}
if (obj.IsUInt)
{
writer.Write(obj.GetUInt());
return;
}
if (obj.IsLong) {
writer.Write (obj.GetLong ());
return;
}
if (obj.IsULong)
{
writer.Write(obj.GetULong());
return;
}
if (obj.IsArray) {
writer.WriteArrayStart ();
foreach (object elem in (IList) obj)
WriteJson ((JsonData) elem, writer);
writer.WriteArrayEnd ();
return;
}
if (obj.IsObject) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in ((IDictionary) obj)) {
writer.WritePropertyName ((string) entry.Key);
WriteJson ((JsonData) entry.Value, writer);
}
writer.WriteObjectEnd ();
return;
}
}
#endregion
public int Add (object value)
{
JsonData data = ToJsonData (value);
json = null;
return EnsureList ().Add (data);
}
public void Clear ()
{
if (IsObject) {
((IDictionary) this).Clear ();
return;
}
if (IsArray) {
((IList) this).Clear ();
return;
}
}
public bool Equals (JsonData x)
{
if (x == null)
return false;
if (x.type != this.type)
{
bool thisIsSigned = (this.type == JsonType.Int || this.type == JsonType.Long);
bool thisIsUnsigned = (this.type == JsonType.UInt || this.type == JsonType.ULong);
bool xIsSigned = (x.type == JsonType.Int || x.type == JsonType.Long);
bool xIsUnsigned = (x.type == JsonType.UInt || x.type == JsonType.ULong);
if (thisIsSigned == xIsSigned || thisIsUnsigned == xIsUnsigned)
{
// only allow types between signed numbers and between unsigned numbers to be actually compared
}
else
{
return false;
}
}
switch (this.type) {
case JsonType.None:
return true;
case JsonType.Object:
return this.inst_object.Equals (x.inst_object);
case JsonType.Array:
return this.inst_array.Equals (x.inst_array);
case JsonType.String:
return this.inst_string.Equals (x.inst_string);
case JsonType.Int:
case JsonType.UInt:
case JsonType.Long:
case JsonType.ULong:
return this.inst_number.Equals (x.inst_number);
case JsonType.Double:
return this.inst_double.Equals (x.inst_double);
case JsonType.Boolean:
return this.inst_boolean.Equals (x.inst_boolean);
}
return false;
}
public JsonType GetJsonType ()
{
return type;
}
public void SetJsonType (JsonType type)
{
if (this.type == type)
return;
switch (type) {
case JsonType.None:
break;
case JsonType.Object:
inst_object = new Dictionary<string, JsonData> ();
object_list = new List<KeyValuePair<string, JsonData>> ();
break;
case JsonType.Array:
inst_array = new List<JsonData> ();
break;
case JsonType.String:
inst_string = default (String);
break;
case JsonType.Int:
inst_number = default (Int32);
break;
case JsonType.UInt:
inst_number = default(UInt32);
break;
case JsonType.Long:
inst_number = default (Int64);
break;
case JsonType.ULong:
inst_number = default(UInt64);
break;
case JsonType.Double:
inst_double = default (Double);
break;
case JsonType.Boolean:
inst_boolean = default (Boolean);
break;
}
this.type = type;
}
public string ToJson ()
{
if (json != null)
return json;
StringWriter sw = new StringWriter ();
JsonWriter writer = new JsonWriter (sw);
writer.Validate = false;
WriteJson (this, writer);
json = sw.ToString ();
return json;
}
public void ToJson (JsonWriter writer)
{
bool old_validate = writer.Validate;
writer.Validate = false;
WriteJson (this, writer);
writer.Validate = old_validate;
}
public override string ToString ()
{
switch (type) {
case JsonType.Array:
return "JsonData array";
case JsonType.Boolean:
return inst_boolean.ToString ();
case JsonType.Double:
return inst_double.ToString ();
case JsonType.Int:
return unchecked((int)inst_number).ToString();
case JsonType.UInt:
return unchecked((uint)inst_number).ToString();
case JsonType.Long:
return unchecked((long)inst_number).ToString();
case JsonType.ULong:
return inst_number.ToString ();
case JsonType.Object:
return "JsonData object";
case JsonType.String:
return inst_string;
}
return "Uninitialized JsonData";
}
}
internal class OrderedDictionaryEnumerator : IDictionaryEnumerator
{
IEnumerator<KeyValuePair<string, JsonData>> list_enumerator;
public object Current {
get { return Entry; }
}
public DictionaryEntry Entry {
get {
KeyValuePair<string, JsonData> curr = list_enumerator.Current;
return new DictionaryEntry (curr.Key, curr.Value);
}
}
public object Key {
get { return list_enumerator.Current.Key; }
}
public object Value {
get { return list_enumerator.Current.Value; }
}
public OrderedDictionaryEnumerator (
IEnumerator<KeyValuePair<string, JsonData>> enumerator)
{
list_enumerator = enumerator;
}
public bool MoveNext ()
{
return list_enumerator.MoveNext ();
}
public void Reset ()
{
list_enumerator.Reset ();
}
}
}
| 1,145 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonException.cs
/// Base class throwed by LitJSON when a parsing error occurs.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
namespace ThirdParty.Json.LitJson
{
#if !NETSTANDARD
[Serializable]
#endif
public class JsonException : Exception
{
public JsonException () : base ()
{
}
internal JsonException (ParserToken token) :
base (String.Format (
"Invalid token '{0}' in input string", token))
{
}
internal JsonException (ParserToken token,
Exception inner_exception) :
base (String.Format (
"Invalid token '{0}' in input string", token),
inner_exception)
{
}
internal JsonException (int c) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c))
{
}
internal JsonException (int c, Exception inner_exception) :
base (String.Format (
"Invalid character '{0}' in input string", (char) c),
inner_exception)
{
}
public JsonException (string message) : base (message)
{
}
public JsonException (string message, Exception inner_exception) :
base (message, inner_exception)
{
}
}
}
| 65 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonMapper.cs
/// JSON to .Net object and object to JSON conversions.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using Amazon.Util;
using Amazon.Util.Internal;
namespace ThirdParty.Json.LitJson
{
internal struct PropertyMetadata
{
public MemberInfo Info;
public bool IsField;
public Type Type;
}
internal struct ArrayMetadata
{
private Type element_type;
private bool is_array;
private bool is_list;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsArray {
get { return is_array; }
set { is_array = value; }
}
public bool IsList {
get { return is_list; }
set { is_list = value; }
}
}
internal struct ObjectMetadata
{
private Type element_type;
private bool is_dictionary;
private IDictionary<string, PropertyMetadata> properties;
public Type ElementType {
get {
if (element_type == null)
return typeof (JsonData);
return element_type;
}
set { element_type = value; }
}
public bool IsDictionary {
get { return is_dictionary; }
set { is_dictionary = value; }
}
public IDictionary<string, PropertyMetadata> Properties {
get { return properties; }
set { properties = value; }
}
}
internal delegate void ExporterFunc (object obj, JsonWriter writer);
public delegate void ExporterFunc<T> (T obj, JsonWriter writer);
internal delegate object ImporterFunc (object input);
public delegate TValue ImporterFunc<TJson, TValue> (TJson input);
public delegate IJsonWrapper WrapperFactory ();
public class JsonMapper
{
#region Fields
private static int max_nesting_depth;
private static IFormatProvider datetime_format;
private static IDictionary<Type, ExporterFunc> base_exporters_table;
private static IDictionary<Type, ExporterFunc> custom_exporters_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> base_importers_table;
private static IDictionary<Type,
IDictionary<Type, ImporterFunc>> custom_importers_table;
private static IDictionary<Type, ArrayMetadata> array_metadata;
private static readonly object array_metadata_lock = new Object ();
private static IDictionary<Type,
IDictionary<Type, MethodInfo>> conv_ops;
private static readonly object conv_ops_lock = new Object ();
private static IDictionary<Type, ObjectMetadata> object_metadata;
private static readonly object object_metadata_lock = new Object ();
private static IDictionary<Type,
IList<PropertyMetadata>> type_properties;
private static readonly object type_properties_lock = new Object ();
private static JsonWriter static_writer;
private static readonly object static_writer_lock = new Object ();
private static readonly HashSet<string> dictionary_properties_to_ignore = new HashSet<string>(StringComparer.Ordinal)
{
"Comparer", "Count", "Keys", "Values"
};
#endregion
#region Constructors
static JsonMapper ()
{
max_nesting_depth = 100;
array_metadata = new Dictionary<Type, ArrayMetadata> ();
conv_ops = new Dictionary<Type, IDictionary<Type, MethodInfo>> ();
object_metadata = new Dictionary<Type, ObjectMetadata> ();
type_properties = new Dictionary<Type,
IList<PropertyMetadata>> ();
static_writer = new JsonWriter ();
datetime_format = DateTimeFormatInfo.InvariantInfo;
base_exporters_table = new Dictionary<Type, ExporterFunc> ();
custom_exporters_table = new Dictionary<Type, ExporterFunc> ();
base_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
custom_importers_table = new Dictionary<Type,
IDictionary<Type, ImporterFunc>> ();
RegisterBaseExporters ();
RegisterBaseImporters ();
}
#endregion
#region Private Methods
private static void AddArrayMetadata (Type type)
{
if (array_metadata.ContainsKey (type))
return;
ArrayMetadata data = new ArrayMetadata ();
data.IsArray = type.IsArray;
var typeInfo = TypeFactory.GetTypeInfo(type);
if (typeInfo.GetInterface("System.Collections.IList") != null)
data.IsList = true;
foreach (PropertyInfo p_info in typeInfo.GetProperties())
{
if (p_info.Name != "Item")
continue;
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (int))
data.ElementType = p_info.PropertyType;
}
lock (array_metadata_lock) {
try {
array_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddObjectMetadata (Type type)
{
if (object_metadata.ContainsKey (type))
return;
ObjectMetadata data = new ObjectMetadata ();
var typeInfo = TypeFactory.GetTypeInfo(type);
if (typeInfo.GetInterface("System.Collections.IDictionary") != null)
data.IsDictionary = true;
data.Properties = new Dictionary<string, PropertyMetadata> ();
foreach (PropertyInfo p_info in typeInfo.GetProperties())
{
if (p_info.Name == "Item") {
ParameterInfo[] parameters = p_info.GetIndexParameters ();
if (parameters.Length != 1)
continue;
if (parameters[0].ParameterType == typeof (string))
data.ElementType = p_info.PropertyType;
continue;
}
if (data.IsDictionary && dictionary_properties_to_ignore.Contains(p_info.Name))
continue;
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.Type = p_info.PropertyType;
data.Properties.Add (p_info.Name, p_data);
}
foreach (FieldInfo f_info in typeInfo.GetFields())
{
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
p_data.Type = f_info.FieldType;
data.Properties.Add (f_info.Name, p_data);
}
lock (object_metadata_lock) {
try {
object_metadata.Add (type, data);
} catch (ArgumentException) {
return;
}
}
}
private static void AddTypeProperties (Type type)
{
if (type_properties.ContainsKey (type))
return;
var typeInfo = TypeFactory.GetTypeInfo(type);
IList<PropertyMetadata> props = new List<PropertyMetadata> ();
foreach (PropertyInfo p_info in typeInfo.GetProperties())
{
if (p_info.Name == "Item")
continue;
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = p_info;
p_data.IsField = false;
props.Add (p_data);
}
foreach (FieldInfo f_info in typeInfo.GetFields())
{
PropertyMetadata p_data = new PropertyMetadata ();
p_data.Info = f_info;
p_data.IsField = true;
props.Add (p_data);
}
lock (type_properties_lock) {
try {
type_properties.Add (type, props);
} catch (ArgumentException) {
return;
}
}
}
private static MethodInfo GetConvOp (Type t1, Type t2)
{
lock (conv_ops_lock) {
if (! conv_ops.ContainsKey (t1))
conv_ops.Add (t1, new Dictionary<Type, MethodInfo> ());
}
var typeInfoT1 = TypeFactory.GetTypeInfo(t1);
var typeInfoT2 = TypeFactory.GetTypeInfo(t2);
if (conv_ops[t1].ContainsKey (t2))
return conv_ops[t1][t2];
MethodInfo op = typeInfoT1.GetMethod(
"op_Implicit", new ITypeInfo[] { typeInfoT2 });
lock (conv_ops_lock) {
try {
conv_ops[t1].Add (t2, op);
} catch (ArgumentException) {
return conv_ops[t1][t2];
}
}
return op;
}
private static object ReadValue (Type inst_type, JsonReader reader)
{
reader.Read ();
var inst_typeInfo = TypeFactory.GetTypeInfo(inst_type);
if (reader.Token == JsonToken.ArrayEnd)
return null;
//support for nullable types
Type underlying_type = Nullable.GetUnderlyingType(inst_type);
Type value_type = underlying_type ?? inst_type;
if (reader.Token == JsonToken.Null) {
if (inst_typeInfo.IsClass || underlying_type != null)
{
return null;
}
throw new JsonException (String.Format (
"Can't assign null to an instance of type {0}",
inst_type));
}
if (reader.Token == JsonToken.Double ||
reader.Token == JsonToken.Int ||
reader.Token == JsonToken.UInt ||
reader.Token == JsonToken.Long ||
reader.Token == JsonToken.ULong ||
reader.Token == JsonToken.String ||
reader.Token == JsonToken.Boolean) {
Type json_type = reader.Value.GetType ();
var json_typeInfo = TypeFactory.GetTypeInfo(json_type);
if (inst_typeInfo.IsAssignableFrom(json_typeInfo))
return reader.Value;
// If there's a custom importer that fits, use it
if (custom_importers_table.ContainsKey (json_type) &&
custom_importers_table[json_type].ContainsKey (
value_type)) {
ImporterFunc importer =
custom_importers_table[json_type][value_type];
return importer (reader.Value);
}
// Maybe there's a base importer that works
if (base_importers_table.ContainsKey (json_type) &&
base_importers_table[json_type].ContainsKey (
value_type)) {
ImporterFunc importer =
base_importers_table[json_type][value_type];
return importer (reader.Value);
}
// Maybe it's an enum
if (inst_typeInfo.IsEnum)
return Enum.ToObject (value_type, reader.Value);
// Try using an implicit conversion operator
MethodInfo conv_op = GetConvOp (value_type, json_type);
if (conv_op != null)
return conv_op.Invoke (null,
new object[] { reader.Value });
// No luck
throw new JsonException (String.Format (
"Can't assign value '{0}' (type {1}) to type {2}",
reader.Value, json_type, inst_type));
}
object instance = null;
if (reader.Token == JsonToken.ArrayStart) {
AddArrayMetadata (inst_type);
ArrayMetadata t_data = array_metadata[inst_type];
if (! t_data.IsArray && ! t_data.IsList)
throw new JsonException (String.Format (
"Type {0} can't act as an array",
inst_type));
IList list;
Type elem_type;
if (! t_data.IsArray) {
list = (IList) Activator.CreateInstance (inst_type);
elem_type = t_data.ElementType;
} else {
list = new List<object> ();
elem_type = inst_type.GetElementType ();
}
while (true) {
object item = ReadValue (elem_type, reader);
if (reader.Token == JsonToken.ArrayEnd)
break;
list.Add (item);
}
if (t_data.IsArray) {
int n = list.Count;
instance = Array.CreateInstance (elem_type, n);
for (int i = 0; i < n; i++)
((Array) instance).SetValue (list[i], i);
} else
instance = list;
} else if (reader.Token == JsonToken.ObjectStart) {
AddObjectMetadata (value_type);
ObjectMetadata t_data = object_metadata[value_type];
instance = Activator.CreateInstance (value_type);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
if (t_data.Properties.ContainsKey (property)) {
PropertyMetadata prop_data =
t_data.Properties[property];
if (prop_data.IsField) {
((FieldInfo) prop_data.Info).SetValue (
instance, ReadValue (prop_data.Type, reader));
} else {
PropertyInfo p_info =
(PropertyInfo) prop_data.Info;
if (p_info.CanWrite)
p_info.SetValue (
instance,
ReadValue (prop_data.Type, reader),
null);
else
ReadValue (prop_data.Type, reader);
}
} else {
if (! t_data.IsDictionary)
throw new JsonException (String.Format (
"The type {0} doesn't have the " +
"property '{1}'", inst_type, property));
((IDictionary) instance).Add (
property, ReadValue (
t_data.ElementType, reader));
}
}
}
ValidateRequiredFields(instance, inst_type);
return instance;
}
private static void ValidateRequiredFields(object instance, Type inst_type)
{
var typeInfo = TypeFactory.GetTypeInfo(inst_type);
foreach (var prop in typeInfo.GetProperties())
{
var customAttributes = prop.GetCustomAttributes(typeof(JsonPropertyAttribute), false);
if (!customAttributes.Any()) continue;
var jsonAttributeVal = (JsonPropertyAttribute)customAttributes.First();
if (typeInfo.GetProperty(prop.Name).GetValue(instance, null) == null &&
jsonAttributeVal.Required)
{
throw new JsonException ($"The type {instance.GetType()} doesn't have the required " +
$"property '{prop}' set");
}
}
}
private static IJsonWrapper ReadValue (WrapperFactory factory,
JsonReader reader)
{
reader.Read ();
if (reader.Token == JsonToken.ArrayEnd ||
reader.Token == JsonToken.Null)
return null;
IJsonWrapper instance = factory ();
if (reader.Token == JsonToken.String) {
instance.SetString ((string) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Double) {
instance.SetDouble ((double) reader.Value);
return instance;
}
if (reader.Token == JsonToken.Int) {
instance.SetInt ((int) reader.Value);
return instance;
}
if (reader.Token == JsonToken.UInt) {
instance.SetUInt((uint)reader.Value);
return instance;
}
if (reader.Token == JsonToken.Long) {
instance.SetLong ((long) reader.Value);
return instance;
}
if (reader.Token == JsonToken.ULong) {
instance.SetULong((ulong)reader.Value);
return instance;
}
if (reader.Token == JsonToken.Boolean) {
instance.SetBoolean ((bool) reader.Value);
return instance;
}
if (reader.Token == JsonToken.ArrayStart) {
instance.SetJsonType (JsonType.Array);
while (true) {
IJsonWrapper item = ReadValue (factory, reader);
// nij - added check to see if the item is not null. This is to handle arrays within arrays.
// In those cases when the outer array read the inner array an item was returned back the current
// reader.Token is at the ArrayEnd for the inner array.
if (item == null && reader.Token == JsonToken.ArrayEnd)
break;
((IList) instance).Add (item);
}
}
else if (reader.Token == JsonToken.ObjectStart) {
instance.SetJsonType (JsonType.Object);
while (true) {
reader.Read ();
if (reader.Token == JsonToken.ObjectEnd)
break;
string property = (string) reader.Value;
((IDictionary) instance)[property] = ReadValue (
factory, reader);
}
}
return instance;
}
private static void RegisterBaseExporters ()
{
base_exporters_table[typeof (byte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((byte) obj));
};
base_exporters_table[typeof (char)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((char) obj));
};
base_exporters_table[typeof (DateTime)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToString ((DateTime) obj,
datetime_format));
};
base_exporters_table[typeof (decimal)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((decimal) obj);
};
base_exporters_table[typeof (sbyte)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((sbyte) obj));
};
base_exporters_table[typeof (short)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((short) obj));
};
base_exporters_table[typeof (ushort)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToInt32 ((ushort) obj));
};
base_exporters_table[typeof (uint)] =
delegate (object obj, JsonWriter writer) {
writer.Write (Convert.ToUInt64 ((uint) obj));
};
base_exporters_table[typeof (ulong)] =
delegate (object obj, JsonWriter writer) {
writer.Write ((ulong) obj);
};
base_exporters_table[typeof(float)] =
delegate (object obj,JsonWriter writer){
writer.Write(Convert.ToDouble((float) obj));
};
base_exporters_table[typeof(Int64)] =
delegate (object obj,JsonWriter writer){
writer.Write(Convert.ToDouble((Int64) obj));
};
}
private static void RegisterBaseImporters ()
{
ImporterFunc importer;
importer = delegate (object input) {
return Convert.ToByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (byte), importer);
importer = delegate (object input) {
return Convert.ToUInt64 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ulong), importer);
importer = delegate (object input) {
return Convert.ToSByte ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (sbyte), importer);
importer = delegate (object input) {
return Convert.ToInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (short), importer);
importer = delegate (object input) {
return Convert.ToUInt16 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (ushort), importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToSingle ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (float), importer);
importer = delegate (object input) {
return Convert.ToDouble ((int) input);
};
RegisterImporter (base_importers_table, typeof (int),
typeof (double), importer);
importer = delegate (object input) {
return Convert.ToDecimal ((double) input);
};
RegisterImporter (base_importers_table, typeof (double),
typeof (decimal), importer);
importer = delegate(object input)
{
return Convert.ToSingle((float)(double)input);
};
RegisterImporter(base_importers_table,typeof(double),
typeof(float),importer);
importer = delegate (object input) {
return Convert.ToUInt32 ((long) input);
};
RegisterImporter (base_importers_table, typeof (long),
typeof (uint), importer);
importer = delegate (object input) {
return Convert.ToChar ((string) input);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (char), importer);
importer = delegate (object input) {
return Convert.ToDateTime ((string) input, datetime_format);
};
RegisterImporter (base_importers_table, typeof (string),
typeof (DateTime), importer);
importer = delegate(object input) {
return Convert.ToInt64 ((Int32)input);
};
RegisterImporter (base_importers_table, typeof (Int32),
typeof(Int64), importer);
}
private static void RegisterImporter (
IDictionary<Type, IDictionary<Type, ImporterFunc>> table,
Type json_type, Type value_type, ImporterFunc importer)
{
if (! table.ContainsKey (json_type))
table.Add (json_type, new Dictionary<Type, ImporterFunc> ());
table[json_type][value_type] = importer;
}
private static void WriteValue (object obj, JsonWriter writer,
bool writer_is_private,
int depth)
{
if (depth > max_nesting_depth)
throw new JsonException (
String.Format ("Max allowed object depth reached while " +
"trying to export from type {0}",
obj.GetType ()));
if (obj == null) {
writer.Write (null);
return;
}
if (obj is IJsonWrapper) {
if (writer_is_private)
writer.TextWriter.Write (((IJsonWrapper) obj).ToJson ());
else
((IJsonWrapper) obj).ToJson (writer);
return;
}
if (obj is String) {
writer.Write ((string) obj);
return;
}
if (obj is Double) {
writer.Write ((double) obj);
return;
}
if (obj is Int32) {
writer.Write ((int) obj);
return;
}
if (obj is UInt32)
{
writer.Write((uint)obj);
return;
}
if (obj is Boolean) {
writer.Write ((bool) obj);
return;
}
if (obj is Int64) {
writer.Write ((long) obj);
return;
}
if (obj is UInt64)
{
writer.Write((ulong)obj);
}
if (obj is Array) {
writer.WriteArrayStart ();
foreach (object elem in (Array) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IList) {
writer.WriteArrayStart ();
foreach (object elem in (IList) obj)
WriteValue (elem, writer, writer_is_private, depth + 1);
writer.WriteArrayEnd ();
return;
}
if (obj is IDictionary) {
writer.WriteObjectStart ();
foreach (DictionaryEntry entry in (IDictionary) obj) {
writer.WritePropertyName ((string) entry.Key);
WriteValue (entry.Value, writer, writer_is_private,
depth + 1);
}
writer.WriteObjectEnd ();
return;
}
Type obj_type = obj.GetType ();
// See if there's a custom exporter for the object
if (custom_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = custom_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// If not, maybe there's a base exporter
if (base_exporters_table.ContainsKey (obj_type)) {
ExporterFunc exporter = base_exporters_table[obj_type];
exporter (obj, writer);
return;
}
// Last option, let's see if it's an enum
if (obj is Enum) {
Type e_type = Enum.GetUnderlyingType (obj_type);
if (e_type == typeof (long)
|| e_type == typeof (uint)
|| e_type == typeof (ulong))
writer.Write ((ulong) obj);
else
writer.Write ((int) obj);
return;
}
// Okay, so it looks like the input should be exported as an
// object
AddTypeProperties (obj_type);
IList<PropertyMetadata> props = type_properties[obj_type];
writer.WriteObjectStart ();
foreach (PropertyMetadata p_data in props) {
if (p_data.IsField) {
writer.WritePropertyName (p_data.Info.Name);
WriteValue (((FieldInfo) p_data.Info).GetValue (obj),
writer, writer_is_private, depth + 1);
}
else {
PropertyInfo p_info = (PropertyInfo) p_data.Info;
if (p_info.CanRead)
{
writer.WritePropertyName(p_data.Info.Name);
WriteValue(p_info.GetGetMethod().Invoke(obj, null),
writer, writer_is_private, depth + 1);
}
}
}
writer.WriteObjectEnd ();
}
#endregion
public static string ToJson (object obj)
{
lock (static_writer_lock) {
static_writer.Reset ();
WriteValue (obj, static_writer, true, 0);
return static_writer.ToString ();
}
}
public static void ToJson (object obj, JsonWriter writer)
{
WriteValue (obj, writer, false, 0);
}
public static JsonData ToObject (JsonReader reader)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, reader);
}
public static JsonData ToObject (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json_reader);
}
public static JsonData ToObject (string json)
{
return (JsonData) ToWrapper (
delegate { return new JsonData (); }, json);
}
public static T ToObject<T> (JsonReader reader)
{
return (T) ReadValue (typeof (T), reader);
}
public static T ToObject<T> (TextReader reader)
{
JsonReader json_reader = new JsonReader (reader);
return (T) ReadValue (typeof (T), json_reader);
}
public static T ToObject<T> (string json)
{
JsonReader reader = new JsonReader (json);
return (T) ReadValue (typeof (T), reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
JsonReader reader)
{
return ReadValue (factory, reader);
}
public static IJsonWrapper ToWrapper (WrapperFactory factory,
string json)
{
JsonReader reader = new JsonReader (json);
return ReadValue (factory, reader);
}
public static void RegisterExporter<T> (ExporterFunc<T> exporter)
{
ExporterFunc exporter_wrapper =
delegate (object obj, JsonWriter writer) {
exporter ((T) obj, writer);
};
custom_exporters_table[typeof (T)] = exporter_wrapper;
}
public static void RegisterImporter<TJson, TValue> (
ImporterFunc<TJson, TValue> importer)
{
ImporterFunc importer_wrapper =
delegate (object input) {
return importer ((TJson) input);
};
RegisterImporter (custom_importers_table, typeof (TJson),
typeof (TValue), importer_wrapper);
}
public static void UnregisterExporters ()
{
custom_exporters_table.Clear ();
}
public static void UnregisterImporters ()
{
custom_importers_table.Clear ();
}
}
[AttributeUsage(AttributeTargets.Property)]
public class JsonPropertyAttribute: Attribute
{
public bool Required { get; set; }
}
}
| 1,014 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonReader.cs
/// Stream-like access to JSON text.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace ThirdParty.Json.LitJson
{
public enum JsonToken
{
None,
ObjectStart,
PropertyName,
ObjectEnd,
ArrayStart,
ArrayEnd,
Int,
UInt,
Long,
ULong,
Double,
String,
Boolean,
Null
}
public class JsonReader
{
#region Fields
private Stack<JsonToken> depth = new Stack<JsonToken>();
private int current_input;
private int current_symbol;
private bool end_of_json;
private bool end_of_input;
private Lexer lexer;
private bool parser_in_string;
private bool parser_return;
private bool read_started;
private TextReader reader;
private bool reader_is_owned;
private object token_value;
private JsonToken token;
#endregion
#region Public Properties
public bool AllowComments {
get { return lexer.AllowComments; }
set { lexer.AllowComments = value; }
}
public bool AllowSingleQuotedStrings {
get { return lexer.AllowSingleQuotedStrings; }
set { lexer.AllowSingleQuotedStrings = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public bool EndOfJson {
get { return end_of_json; }
}
public JsonToken Token {
get { return token; }
}
public object Value {
get { return token_value; }
}
#endregion
#region Constructors
public JsonReader (string json_text) :
this (new StringReader (json_text), true)
{
}
public JsonReader (TextReader reader) :
this (reader, false)
{
}
private JsonReader (TextReader reader, bool owned)
{
if (reader == null)
throw new ArgumentNullException ("reader");
parser_in_string = false;
parser_return = false;
read_started = false;
lexer = new Lexer (reader);
end_of_input = false;
end_of_json = false;
this.reader = reader;
reader_is_owned = owned;
}
#endregion
#region Private Methods
private void ProcessNumber (string number)
{
if (number.IndexOf ('.') != -1 ||
number.IndexOf ('e') != -1 ||
number.IndexOf ('E') != -1) {
double n_double;
if (Double.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_double))
{
token = JsonToken.Double;
token_value = n_double;
return;
}
}
int n_int32;
if (Int32.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_int32))
{
token = JsonToken.Int;
token_value = n_int32;
return;
}
uint n_uint32;
if (UInt32.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_uint32))
{
token = JsonToken.UInt;
token_value = n_uint32;
return;
}
long n_int64;
if (Int64.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_int64))
{
token = JsonToken.Long;
token_value = n_int64;
return;
}
ulong n_uint64;
if (UInt64.TryParse(number, NumberStyles.Any, CultureInfo.InvariantCulture, out n_uint64))
{
token = JsonToken.ULong;
token_value = n_uint64;
return;
}
// Shouldn't happen, but just in case, return something
token = JsonToken.ULong;
token_value = default(ulong);
}
private void ProcessSymbol ()
{
if (current_symbol == '[') {
token = JsonToken.ArrayStart;
parser_return = true;
} else if (current_symbol == ']') {
token = JsonToken.ArrayEnd;
parser_return = true;
} else if (current_symbol == '{') {
token = JsonToken.ObjectStart;
parser_return = true;
} else if (current_symbol == '}') {
token = JsonToken.ObjectEnd;
parser_return = true;
} else if (current_symbol == '"') {
if (parser_in_string) {
parser_in_string = false;
parser_return = true;
} else {
if (token == JsonToken.None)
token = JsonToken.String;
parser_in_string = true;
}
} else if (current_symbol == (int) ParserToken.CharSeq) {
token_value = lexer.StringValue;
} else if (current_symbol == (int) ParserToken.False) {
token = JsonToken.Boolean;
token_value = false;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Null) {
token = JsonToken.Null;
parser_return = true;
} else if (current_symbol == (int) ParserToken.Number) {
ProcessNumber (lexer.StringValue);
parser_return = true;
} else if (current_symbol == (int) ParserToken.Pair) {
token = JsonToken.PropertyName;
} else if (current_symbol == (int) ParserToken.True) {
token = JsonToken.Boolean;
token_value = true;
parser_return = true;
}
}
private bool ReadToken ()
{
if (end_of_input)
return false;
lexer.NextToken ();
if (lexer.EndOfInput) {
Close ();
return false;
}
current_input = lexer.Token;
return true;
}
#endregion
public void Close ()
{
if (end_of_input)
return;
end_of_input = true;
end_of_json = true;
reader = null;
}
public bool Read()
{
if (end_of_input)
return false;
if (end_of_json)
{
end_of_json = false;
}
token = JsonToken.None;
parser_in_string = false;
parser_return = false;
// Check if the first read call. If so then do an extra ReadToken because Read assumes that the previous
// call to Read has already called ReadToken.
if (!read_started)
{
read_started = true;
if (!ReadToken())
return false;
}
do
{
current_symbol = current_input;
ProcessSymbol();
if (parser_return)
{
if (this.token == JsonToken.ObjectStart || this.token == JsonToken.ArrayStart)
{
depth.Push(this.token);
}
else if (this.token == JsonToken.ObjectEnd || this.token == JsonToken.ArrayEnd)
{
// Clear out property name if is on top. This could happen if the value for the property was null.
if (depth.Peek() == JsonToken.PropertyName)
depth.Pop();
// Pop the opening token for this closing token. Make sure it is of the right type otherwise
// the document is invalid.
var opening = depth.Pop();
if (this.token == JsonToken.ObjectEnd && opening != JsonToken.ObjectStart)
throw new JsonException("Error: Current token is ObjectEnd which does not match the opening " + opening.ToString());
if (this.token == JsonToken.ArrayEnd && opening != JsonToken.ArrayStart)
throw new JsonException("Error: Current token is ArrayEnd which does not match the opening " + opening.ToString());
// If that last element is popped then we reached the end of the JSON object.
if (depth.Count == 0)
{
end_of_json = true;
}
}
// If the top of the stack is an object start and the next read is a string then it must be a property name
// to add to the stack.
else if (depth.Count > 0 && depth.Peek() != JsonToken.PropertyName &&
this.token == JsonToken.String && depth.Peek() == JsonToken.ObjectStart)
{
this.token = JsonToken.PropertyName;
depth.Push(this.token);
}
if (
(this.token == JsonToken.ObjectEnd ||
this.token == JsonToken.ArrayEnd ||
this.token == JsonToken.String ||
this.token == JsonToken.Boolean ||
this.token == JsonToken.Double ||
this.token == JsonToken.Int ||
this.token == JsonToken.UInt ||
this.token == JsonToken.Long ||
this.token == JsonToken.ULong ||
this.token == JsonToken.Null
))
{
// If we found a value but we are not in an array or object then the document is an invalid json document.
if (depth.Count == 0)
{
if (this.token != JsonToken.ArrayEnd && this.token != JsonToken.ObjectEnd)
{
throw new JsonException("Value without enclosing object or array");
}
}
// The valud of the property has been processed so pop the property name from the stack.
else if (depth.Peek() == JsonToken.PropertyName)
{
depth.Pop();
}
}
// Read the next token that will be processed the next time the Read method is called.
// This is done ahead of the next read so we can detect if we are at the end of the json document.
// Otherwise EndOfInput would not return true until an attempt to read was made.
if (!ReadToken() && depth.Count != 0)
throw new JsonException("Incomplete JSON Document");
return true;
}
} while (ReadToken());
// If we reached the end of the document but there is still elements left in the depth stack then
// the document is invalid JSON.
if (depth.Count != 0)
throw new JsonException("Incomplete JSON Document");
end_of_input = true;
return false;
}
}
}
| 388 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// JsonWriter.cs
/// Stream-like facility to output JSON text.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace ThirdParty.Json.LitJson
{
internal enum Condition
{
InArray,
InObject,
NotAProperty,
Property,
Value
}
internal class WriterContext
{
public int Count;
public bool InArray;
public bool InObject;
public bool ExpectingValue;
public int Padding;
}
public class JsonWriter
{
#region Fields
private static NumberFormatInfo number_format;
private WriterContext context;
private Stack<WriterContext> ctx_stack;
private bool has_reached_end;
private char[] hex_seq;
private int indentation;
private int indent_value;
private StringBuilder inst_string_builder;
private bool pretty_print;
private bool validate;
private TextWriter writer;
#endregion
#region Properties
public int IndentValue {
get { return indent_value; }
set {
indentation = (indentation / indent_value) * value;
indent_value = value;
}
}
public bool PrettyPrint {
get { return pretty_print; }
set { pretty_print = value; }
}
public TextWriter TextWriter {
get { return writer; }
}
public bool Validate {
get { return validate; }
set { validate = value; }
}
#endregion
#region Constructors
static JsonWriter ()
{
number_format = NumberFormatInfo.InvariantInfo;
}
public JsonWriter ()
{
inst_string_builder = new StringBuilder ();
writer = new StringWriter (inst_string_builder);
Init ();
}
public JsonWriter (StringBuilder sb) :
this (new StringWriter (sb))
{
}
public JsonWriter (TextWriter writer)
{
if (writer == null)
throw new ArgumentNullException ("writer");
this.writer = writer;
Init ();
}
#endregion
#region Private Methods
private void DoValidation (Condition cond)
{
if (! context.ExpectingValue)
context.Count++;
if (! validate)
return;
if (has_reached_end)
throw new JsonException (
"A complete JSON symbol has already been written");
switch (cond) {
case Condition.InArray:
if (! context.InArray)
throw new JsonException (
"Can't close an array here");
break;
case Condition.InObject:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't close an object here");
break;
case Condition.NotAProperty:
if (context.InObject && ! context.ExpectingValue)
throw new JsonException (
"Expected a property");
break;
case Condition.Property:
if (! context.InObject || context.ExpectingValue)
throw new JsonException (
"Can't add a property here");
break;
case Condition.Value:
if (! context.InArray &&
(! context.InObject || ! context.ExpectingValue))
throw new JsonException (
"Can't add a value here");
break;
}
}
private void Init ()
{
has_reached_end = false;
hex_seq = new char[4];
indentation = 0;
indent_value = 4;
pretty_print = false;
validate = true;
ctx_stack = new Stack<WriterContext> ();
context = new WriterContext ();
ctx_stack.Push (context);
}
private static void IntToHex (int n, char[] hex)
{
int num;
for (int i = 0; i < 4; i++) {
num = n % 16;
if (num < 10)
hex[3 - i] = (char) ('0' + num);
else
hex[3 - i] = (char) ('A' + (num - 10));
n >>= 4;
}
}
private void Indent ()
{
if (pretty_print)
indentation += indent_value;
}
private void Put (string str)
{
if (pretty_print && ! context.ExpectingValue)
for (int i = 0; i < indentation; i++)
writer.Write (' ');
writer.Write (str);
}
private void PutNewline ()
{
PutNewline (true);
}
private void PutNewline (bool add_comma)
{
if (add_comma && ! context.ExpectingValue &&
context.Count > 1)
writer.Write (',');
if (pretty_print && ! context.ExpectingValue)
writer.Write ("\r\n");
}
private void PutString (string str)
{
Put (String.Empty);
writer.Write ('"');
int n = str.Length;
for (int i = 0; i < n; i++)
{
char c = str[i];
switch (c) {
case '\n':
writer.Write ("\\n");
continue;
case '\r':
writer.Write ("\\r");
continue;
case '\t':
writer.Write ("\\t");
continue;
case '"':
case '\\':
writer.Write ('\\');
writer.Write (c);
continue;
case '\f':
writer.Write ("\\f");
continue;
case '\b':
writer.Write ("\\b");
continue;
}
if ((int) c >= 32 && (int) c <= 126) {
writer.Write (c);
continue;
}
if (c < ' ' || (c >= '\u0080' && c < '\u00a0'))
{
// Turn into a \uXXXX sequence
IntToHex((int)c, hex_seq);
writer.Write("\\u");
writer.Write(hex_seq);
}
else
{
writer.Write(c);
}
}
writer.Write ('"');
}
private void Unindent ()
{
if (pretty_print)
indentation -= indent_value;
}
#endregion
public override string ToString ()
{
if (inst_string_builder == null)
return String.Empty;
return inst_string_builder.ToString ();
}
public void Reset ()
{
has_reached_end = false;
ctx_stack.Clear ();
context = new WriterContext ();
ctx_stack.Push (context);
if (inst_string_builder != null)
inst_string_builder.Remove (0, inst_string_builder.Length);
}
public void Write (bool boolean)
{
DoValidation (Condition.Value);
PutNewline ();
Put (boolean ? "true" : "false");
context.ExpectingValue = false;
}
public void Write (decimal number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write (double number)
{
DoValidation (Condition.Value);
PutNewline ();
// Modified to support roundtripping of double.MaxValue
string str = number.ToString("R", CultureInfo.InvariantCulture);
Put (str);
if (str.IndexOf ('.') == -1 &&
str.IndexOf ('E') == -1)
writer.Write (".0");
context.ExpectingValue = false;
}
public void Write (int number)
{
DoValidation(Condition.Value);
PutNewline ();
Put(Convert.ToString(number, number_format));
context.ExpectingValue = false;
}
public void Write(uint number)
{
DoValidation(Condition.Value);
PutNewline();
Put(Convert.ToString(number, number_format));
context.ExpectingValue = false;
}
public void Write(long number)
{
DoValidation(Condition.Value);
PutNewline();
Put(Convert.ToString(number, number_format));
context.ExpectingValue = false;
}
public void Write (string str)
{
DoValidation (Condition.Value);
PutNewline ();
if (str == null)
Put ("null");
else
PutString (str);
context.ExpectingValue = false;
}
public void WriteRaw(string str)
{
DoValidation(Condition.Value);
PutNewline();
if (str == null)
Put("null");
else
Put(str);
context.ExpectingValue = false;
}
[CLSCompliant(false)]
public void Write (ulong number)
{
DoValidation (Condition.Value);
PutNewline ();
Put (Convert.ToString (number, number_format));
context.ExpectingValue = false;
}
public void Write(DateTime date)
{
DoValidation(Condition.Value);
PutNewline();
Put(Amazon.Util.AWSSDKUtils.ConvertToUnixEpochSecondsDouble(date).ToString(CultureInfo.InvariantCulture));
context.ExpectingValue = false;
}
public void WriteArrayEnd ()
{
DoValidation (Condition.InArray);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("]");
}
public void WriteArrayStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("[");
context = new WriterContext ();
context.InArray = true;
ctx_stack.Push (context);
Indent ();
}
public void WriteObjectEnd ()
{
DoValidation (Condition.InObject);
PutNewline (false);
ctx_stack.Pop ();
if (ctx_stack.Count == 1)
has_reached_end = true;
else {
context = ctx_stack.Peek ();
context.ExpectingValue = false;
}
Unindent ();
Put ("}");
}
public void WriteObjectStart ()
{
DoValidation (Condition.NotAProperty);
PutNewline ();
Put ("{");
context = new WriterContext ();
context.InObject = true;
ctx_stack.Push (context);
Indent ();
}
public void WritePropertyName (string property_name)
{
DoValidation (Condition.Property);
PutNewline ();
PutString (property_name);
if (pretty_print) {
if (property_name.Length > context.Padding)
context.Padding = property_name.Length;
for (int i = context.Padding - property_name.Length;
i >= 0; i--)
writer.Write (' ');
writer.Write (": ");
} else
writer.Write (':');
context.ExpectingValue = true;
}
}
}
| 509 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// Lexer.cs
/// JSON lexer implementation based on a finite state machine.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace ThirdParty.Json.LitJson
{
internal class FsmContext
{
public bool Return;
public int NextState;
public Lexer L;
public int StateStack;
}
internal class Lexer
{
#region Fields
private delegate bool StateHandler (FsmContext ctx);
private static int[] fsm_return_table;
private static StateHandler[] fsm_handler_table;
private bool allow_comments;
private bool allow_single_quoted_strings;
private bool end_of_input;
private FsmContext fsm_context;
private int input_buffer;
private int input_char;
private TextReader reader;
private int state;
private StringBuilder string_buffer;
private string string_value;
private int token;
private int unichar;
#endregion
#region Properties
public bool AllowComments {
get { return allow_comments; }
set { allow_comments = value; }
}
public bool AllowSingleQuotedStrings {
get { return allow_single_quoted_strings; }
set { allow_single_quoted_strings = value; }
}
public bool EndOfInput {
get { return end_of_input; }
}
public int Token {
get { return token; }
}
public string StringValue {
get { return string_value; }
}
#endregion
#region Constructors
static Lexer ()
{
PopulateFsmTables ();
}
public Lexer (TextReader reader)
{
allow_comments = true;
allow_single_quoted_strings = true;
input_buffer = 0;
string_buffer = new StringBuilder (128);
state = 1;
end_of_input = false;
this.reader = reader;
fsm_context = new FsmContext ();
fsm_context.L = this;
}
#endregion
#region Static Methods
private static int HexValue (int digit)
{
switch (digit) {
case 'a':
case 'A':
return 10;
case 'b':
case 'B':
return 11;
case 'c':
case 'C':
return 12;
case 'd':
case 'D':
return 13;
case 'e':
case 'E':
return 14;
case 'f':
case 'F':
return 15;
default:
return digit - '0';
}
}
private static void PopulateFsmTables ()
{
fsm_handler_table = new StateHandler[28] {
State1,
State2,
State3,
State4,
State5,
State6,
State7,
State8,
State9,
State10,
State11,
State12,
State13,
State14,
State15,
State16,
State17,
State18,
State19,
State20,
State21,
State22,
State23,
State24,
State25,
State26,
State27,
State28
};
fsm_return_table = new int[28] {
(int) ParserToken.Char,
0,
(int) ParserToken.Number,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
(int) ParserToken.Number,
0,
0,
(int) ParserToken.True,
0,
0,
0,
(int) ParserToken.False,
0,
0,
(int) ParserToken.Null,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
(int) ParserToken.CharSeq,
(int) ParserToken.Char,
0,
0,
0,
0
};
}
private static char ProcessEscChar (int esc_char)
{
switch (esc_char) {
case '"':
case '\'':
case '\\':
case '/':
return Convert.ToChar (esc_char);
case 'n':
return '\n';
case 't':
return '\t';
case 'r':
return '\r';
case 'b':
return '\b';
case 'f':
return '\f';
default:
// Unreachable
return '?';
}
}
private static bool State1 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r')
continue;
if (ctx.L.input_char >= '1' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '"':
ctx.NextState = 19;
ctx.Return = true;
return true;
case ',':
case ':':
case '[':
case ']':
case '{':
case '}':
ctx.NextState = 1;
ctx.Return = true;
return true;
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 2;
return true;
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
case 'f':
ctx.NextState = 12;
return true;
case 'n':
ctx.NextState = 16;
return true;
case 't':
ctx.NextState = 9;
return true;
case '\'':
if (! ctx.L.allow_single_quoted_strings)
return false;
ctx.L.input_char = '"';
ctx.NextState = 23;
ctx.Return = true;
return true;
case '/':
if (! ctx.L.allow_comments)
return false;
ctx.NextState = 25;
return true;
default:
return false;
}
}
return true;
}
private static bool State2 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '1' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 3;
return true;
}
switch (ctx.L.input_char) {
case '0':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 4;
return true;
default:
return false;
}
}
private static bool State3 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State4 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case '.':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 5;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
private static bool State5 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 6;
return true;
}
return false;
}
private static bool State6 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char <= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
case 'e':
case 'E':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 7;
return true;
default:
return false;
}
}
return true;
}
private static bool State7 (FsmContext ctx)
{
ctx.L.GetChar ();
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
}
switch (ctx.L.input_char) {
case '+':
case '-':
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
ctx.NextState = 8;
return true;
default:
return false;
}
}
private static bool State8 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char<= '9') {
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
if (ctx.L.input_char == ' ' ||
ctx.L.input_char >= '\t' && ctx.L.input_char<= '\r') {
ctx.Return = true;
ctx.NextState = 1;
return true;
}
switch (ctx.L.input_char) {
case ',':
case ']':
case '}':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
return true;
}
private static bool State9 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'r':
ctx.NextState = 10;
return true;
default:
return false;
}
}
private static bool State10 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 11;
return true;
default:
return false;
}
}
private static bool State11 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State12 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'a':
ctx.NextState = 13;
return true;
default:
return false;
}
}
private static bool State13 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 14;
return true;
default:
return false;
}
}
private static bool State14 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 's':
ctx.NextState = 15;
return true;
default:
return false;
}
}
private static bool State15 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'e':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State16 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 17;
return true;
default:
return false;
}
}
private static bool State17 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.NextState = 18;
return true;
default:
return false;
}
}
private static bool State18 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'l':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State19 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '"':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 20;
return true;
case '\\':
ctx.StateStack = 19;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State20 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '"':
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State21 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case 'u':
ctx.NextState = 22;
return true;
case '"':
case '\'':
case '/':
case '\\':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
ctx.L.string_buffer.Append (
ProcessEscChar (ctx.L.input_char));
ctx.NextState = ctx.StateStack;
return true;
default:
return false;
}
}
private static bool State22 (FsmContext ctx)
{
int counter = 0;
int mult = 4096;
ctx.L.unichar = 0;
while (ctx.L.GetChar ()) {
if (ctx.L.input_char >= '0' && ctx.L.input_char <= '9' ||
ctx.L.input_char >= 'A' && ctx.L.input_char <= 'F' ||
ctx.L.input_char >= 'a' && ctx.L.input_char <= 'f') {
ctx.L.unichar += HexValue (ctx.L.input_char) * mult;
counter++;
mult /= 16;
if (counter == 4) {
ctx.L.string_buffer.Append (
Convert.ToChar (ctx.L.unichar));
ctx.NextState = ctx.StateStack;
return true;
}
continue;
}
return false;
}
return true;
}
private static bool State23 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
switch (ctx.L.input_char) {
case '\'':
ctx.L.UngetChar ();
ctx.Return = true;
ctx.NextState = 24;
return true;
case '\\':
ctx.StateStack = 23;
ctx.NextState = 21;
return true;
default:
ctx.L.string_buffer.Append ((char) ctx.L.input_char);
continue;
}
}
return true;
}
private static bool State24 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '\'':
ctx.L.input_char = '"';
ctx.Return = true;
ctx.NextState = 1;
return true;
default:
return false;
}
}
private static bool State25 (FsmContext ctx)
{
ctx.L.GetChar ();
switch (ctx.L.input_char) {
case '*':
ctx.NextState = 27;
return true;
case '/':
ctx.NextState = 26;
return true;
default:
return false;
}
}
private static bool State26 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '\n') {
ctx.NextState = 1;
return true;
}
}
return true;
}
private static bool State27 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*') {
ctx.NextState = 28;
return true;
}
}
return true;
}
private static bool State28 (FsmContext ctx)
{
while (ctx.L.GetChar ()) {
if (ctx.L.input_char == '*')
continue;
if (ctx.L.input_char == '/') {
ctx.NextState = 1;
return true;
}
ctx.NextState = 27;
return true;
}
return true;
}
#endregion
private bool GetChar ()
{
if ((input_char = NextChar ()) != -1)
return true;
end_of_input = true;
return false;
}
private int NextChar ()
{
if (input_buffer != 0) {
int tmp = input_buffer;
input_buffer = 0;
return tmp;
}
return reader.Read ();
}
public bool NextToken ()
{
StateHandler handler;
fsm_context.Return = false;
while (true) {
handler = fsm_handler_table[state - 1];
if (! handler (fsm_context))
throw new JsonException (input_char);
if (end_of_input)
return false;
if (fsm_context.Return) {
string_value = string_buffer.ToString ();
string_buffer.Length = 0;
token = fsm_return_table[state - 1];
if (token == (int) ParserToken.Char)
token = input_char;
state = fsm_context.NextState;
return true;
}
state = fsm_context.NextState;
}
}
private void UngetChar ()
{
input_buffer = input_char;
}
}
}
| 912 |
aws-sdk-net | aws | C# | #pragma warning disable 1587
#region Header
///
/// ParserToken.cs
/// Internal representation of the tokens used by the lexer and the parser.
///
/// The authors disclaim copyright to this source code. For more details, see
/// the COPYING file included with this distribution.
///
#endregion
namespace ThirdParty.Json.LitJson
{
internal enum ParserToken
{
// Lexer tokens
None = System.Char.MaxValue + 1,
Number,
True,
False,
Null,
CharSeq,
// Single char
Char,
// Parser Rules
Text,
Object,
ObjectPrime,
Pair,
PairRest,
Array,
ArrayPrime,
Value,
ValueRest,
String,
// End of input
End,
// The empty rule
Epsilon
}
}
| 46 |
aws-sdk-net | aws | C# | //Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Text;
// **************************************************************
// * Raw implementation of the MD5 hash algorithm
// * from RFC 1321.
// *
// * Written By: Reid Borsuk and Jenny Zheng
// * Copyright (c) Microsoft Corporation. All rights reserved.
// **************************************************************
namespace ThirdParty.MD5
{
// Simple struct for the (a,b,c,d) which is used to compute the mesage digest.
internal struct ABCDStruct
{
public uint A;
public uint B;
public uint C;
public uint D;
}
internal sealed class MD5Core
{
//Prevent CSC from adding a default public constructor
private MD5Core() { }
public static byte[] GetHash(string input, Encoding encoding)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
if (null == encoding)
throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHash(string) overload to use UTF8 Encoding");
byte[] target = encoding.GetBytes(input);
return GetHash(target);
}
public static byte[] GetHash(string input)
{
return GetHash(input, new UTF8Encoding());
}
public static string GetHashString(byte[] input)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
string retval = BitConverter.ToString(GetHash(input));
retval = retval.Replace("-", "");
return retval;
}
public static string GetHashString(string input, Encoding encoding)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
if (null == encoding)
throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHashString(string) overload to use UTF8 Encoding");
byte[] target = encoding.GetBytes(input);
return GetHashString(target);
}
public static string GetHashString(string input)
{
return GetHashString(input, new UTF8Encoding());
}
public static byte[] GetHash(byte[] input)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
//Intitial values defined in RFC 1321
ABCDStruct abcd = new ABCDStruct();
abcd.A = 0x67452301;
abcd.B = 0xefcdab89;
abcd.C = 0x98badcfe;
abcd.D = 0x10325476;
//We pass in the input array by block, the final block of data must be handled specialy for padding & length embeding
int startIndex = 0;
while (startIndex <= input.Length - 64)
{
MD5Core.GetHashBlock(input, ref abcd, startIndex);
startIndex += 64;
}
// The final data block.
return MD5Core.GetHashFinalBlock(input, startIndex, input.Length - startIndex, abcd, (Int64)input.Length * 8);
}
internal static byte[] GetHashFinalBlock(byte[] input, int ibStart, int cbSize, ABCDStruct ABCD, Int64 len)
{
byte[] working = new byte[64];
byte[] length = BitConverter.GetBytes(len);
//Padding is a single bit 1, followed by the number of 0s required to make size congruent to 448 modulo 512. Step 1 of RFC 1321
//The CLR ensures that our buffer is 0-assigned, we don't need to explicitly set it. This is why it ends up being quicker to just
//use a temporary array rather then doing in-place assignment (5% for small inputs)
Array.Copy(input, ibStart, working, 0, cbSize);
working[cbSize] = 0x80;
//We have enough room to store the length in this chunk
if (cbSize < 56)
{
Array.Copy(length, 0, working, 56, 8);
GetHashBlock(working, ref ABCD, 0);
}
else //We need an aditional chunk to store the length
{
GetHashBlock(working, ref ABCD, 0);
//Create an entirely new chunk due to the 0-assigned trick mentioned above, to avoid an extra function call clearing the array
working = new byte[64];
Array.Copy(length, 0, working, 56, 8);
GetHashBlock(working, ref ABCD, 0);
}
byte[] output = new byte[16];
Array.Copy(BitConverter.GetBytes(ABCD.A), 0, output, 0, 4);
Array.Copy(BitConverter.GetBytes(ABCD.B), 0, output, 4, 4);
Array.Copy(BitConverter.GetBytes(ABCD.C), 0, output, 8, 4);
Array.Copy(BitConverter.GetBytes(ABCD.D), 0, output, 12, 4);
return output;
}
// Performs a single block transform of MD5 for a given set of ABCD inputs
/* If implementing your own hashing framework, be sure to set the initial ABCD correctly according to RFC 1321:
// A = 0x67452301;
// B = 0xefcdab89;
// C = 0x98badcfe;
// D = 0x10325476;
*/
internal static void GetHashBlock(byte[] input, ref ABCDStruct ABCDValue, int ibStart)
{
uint[] temp = Converter(input, ibStart);
uint a = ABCDValue.A;
uint b = ABCDValue.B;
uint c = ABCDValue.C;
uint d = ABCDValue.D;
a = r1(a, b, c, d, temp[0], 7, 0xd76aa478);
d = r1(d, a, b, c, temp[1], 12, 0xe8c7b756);
c = r1(c, d, a, b, temp[2], 17, 0x242070db);
b = r1(b, c, d, a, temp[3], 22, 0xc1bdceee);
a = r1(a, b, c, d, temp[4], 7, 0xf57c0faf);
d = r1(d, a, b, c, temp[5], 12, 0x4787c62a);
c = r1(c, d, a, b, temp[6], 17, 0xa8304613);
b = r1(b, c, d, a, temp[7], 22, 0xfd469501);
a = r1(a, b, c, d, temp[8], 7, 0x698098d8);
d = r1(d, a, b, c, temp[9], 12, 0x8b44f7af);
c = r1(c, d, a, b, temp[10], 17, 0xffff5bb1);
b = r1(b, c, d, a, temp[11], 22, 0x895cd7be);
a = r1(a, b, c, d, temp[12], 7, 0x6b901122);
d = r1(d, a, b, c, temp[13], 12, 0xfd987193);
c = r1(c, d, a, b, temp[14], 17, 0xa679438e);
b = r1(b, c, d, a, temp[15], 22, 0x49b40821);
a = r2(a, b, c, d, temp[1], 5, 0xf61e2562);
d = r2(d, a, b, c, temp[6], 9, 0xc040b340);
c = r2(c, d, a, b, temp[11], 14, 0x265e5a51);
b = r2(b, c, d, a, temp[0], 20, 0xe9b6c7aa);
a = r2(a, b, c, d, temp[5], 5, 0xd62f105d);
d = r2(d, a, b, c, temp[10], 9, 0x02441453);
c = r2(c, d, a, b, temp[15], 14, 0xd8a1e681);
b = r2(b, c, d, a, temp[4], 20, 0xe7d3fbc8);
a = r2(a, b, c, d, temp[9], 5, 0x21e1cde6);
d = r2(d, a, b, c, temp[14], 9, 0xc33707d6);
c = r2(c, d, a, b, temp[3], 14, 0xf4d50d87);
b = r2(b, c, d, a, temp[8], 20, 0x455a14ed);
a = r2(a, b, c, d, temp[13], 5, 0xa9e3e905);
d = r2(d, a, b, c, temp[2], 9, 0xfcefa3f8);
c = r2(c, d, a, b, temp[7], 14, 0x676f02d9);
b = r2(b, c, d, a, temp[12], 20, 0x8d2a4c8a);
a = r3(a, b, c, d, temp[5], 4, 0xfffa3942);
d = r3(d, a, b, c, temp[8], 11, 0x8771f681);
c = r3(c, d, a, b, temp[11], 16, 0x6d9d6122);
b = r3(b, c, d, a, temp[14], 23, 0xfde5380c);
a = r3(a, b, c, d, temp[1], 4, 0xa4beea44);
d = r3(d, a, b, c, temp[4], 11, 0x4bdecfa9);
c = r3(c, d, a, b, temp[7], 16, 0xf6bb4b60);
b = r3(b, c, d, a, temp[10], 23, 0xbebfbc70);
a = r3(a, b, c, d, temp[13], 4, 0x289b7ec6);
d = r3(d, a, b, c, temp[0], 11, 0xeaa127fa);
c = r3(c, d, a, b, temp[3], 16, 0xd4ef3085);
b = r3(b, c, d, a, temp[6], 23, 0x04881d05);
a = r3(a, b, c, d, temp[9], 4, 0xd9d4d039);
d = r3(d, a, b, c, temp[12], 11, 0xe6db99e5);
c = r3(c, d, a, b, temp[15], 16, 0x1fa27cf8);
b = r3(b, c, d, a, temp[2], 23, 0xc4ac5665);
a = r4(a, b, c, d, temp[0], 6, 0xf4292244);
d = r4(d, a, b, c, temp[7], 10, 0x432aff97);
c = r4(c, d, a, b, temp[14], 15, 0xab9423a7);
b = r4(b, c, d, a, temp[5], 21, 0xfc93a039);
a = r4(a, b, c, d, temp[12], 6, 0x655b59c3);
d = r4(d, a, b, c, temp[3], 10, 0x8f0ccc92);
c = r4(c, d, a, b, temp[10], 15, 0xffeff47d);
b = r4(b, c, d, a, temp[1], 21, 0x85845dd1);
a = r4(a, b, c, d, temp[8], 6, 0x6fa87e4f);
d = r4(d, a, b, c, temp[15], 10, 0xfe2ce6e0);
c = r4(c, d, a, b, temp[6], 15, 0xa3014314);
b = r4(b, c, d, a, temp[13], 21, 0x4e0811a1);
a = r4(a, b, c, d, temp[4], 6, 0xf7537e82);
d = r4(d, a, b, c, temp[11], 10, 0xbd3af235);
c = r4(c, d, a, b, temp[2], 15, 0x2ad7d2bb);
b = r4(b, c, d, a, temp[9], 21, 0xeb86d391);
ABCDValue.A = unchecked(a + ABCDValue.A);
ABCDValue.B = unchecked(b + ABCDValue.B);
ABCDValue.C = unchecked(c + ABCDValue.C);
ABCDValue.D = unchecked(d + ABCDValue.D);
return;
}
//Manually unrolling these equations nets us a 20% performance improvement
private static uint r1(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + F(b, c, d) + x + t), s))
//F(x, y, z) ((x & y) | ((x ^ 0xFFFFFFFF) & z))
return unchecked(b + LSR((a + ((b & c) | ((b ^ 0xFFFFFFFF) & d)) + x + t), s));
}
private static uint r2(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + G(b, c, d) + x + t), s))
//G(x, y, z) ((x & z) | (y & (z ^ 0xFFFFFFFF)))
return unchecked(b + LSR((a + ((b & d) | (c & (d ^ 0xFFFFFFFF))) + x + t), s));
}
private static uint r3(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + H(b, c, d) + k + i), s))
//H(x, y, z) (x ^ y ^ z)
return unchecked(b + LSR((a + (b ^ c ^ d) + x + t), s));
}
private static uint r4(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + I(b, c, d) + k + i), s))
//I(x, y, z) (y ^ (x | (z ^ 0xFFFFFFFF)))
return unchecked(b + LSR((a + (c ^ (b | (d ^ 0xFFFFFFFF))) + x + t), s));
}
// Implementation of left rotate
// s is an int instead of a uint becuase the CLR requires the argument passed to >>/<< is of
// type int. Doing the demoting inside this function would add overhead.
private static uint LSR(uint i, int s)
{
return ((i << s) | (i >> (32 - s)));
}
//Convert input array into array of UInts
private static uint[] Converter(byte[] input, int ibStart)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable convert null array to array of uInts");
uint[] result = new uint[16];
for (int i = 0; i < 16; i++)
{
result[i] = (uint)input[ibStart + i * 4];
result[i] += (uint)input[ibStart + i * 4 + 1] << 8;
result[i] += (uint)input[ibStart + i * 4 + 2] << 16;
result[i] += (uint)input[ibStart + i * 4 + 3] << 24;
}
return result;
}
}
} | 278 |
aws-sdk-net | aws | C# | //Copyright (c) Microsoft Corporation. All rights reserved.
using System;
// **************************************************************
// * Raw implementation of the MD5 hash algorithm
// * from RFC 1321.
// *
// * Written By: Reid Borsuk and Jenny Zheng
// * Copyright (c) Microsoft Corporation. All rights reserved.
// **************************************************************
namespace ThirdParty.MD5
{
public class MD5Managed : System.Security.Cryptography.HashAlgorithm
{
private byte[] _data;
private ABCDStruct _abcd;
private Int64 _totalLength;
private int _dataSize;
public MD5Managed()
{
base.HashSizeValue = 0x80;
this.Initialize();
}
public override void Initialize()
{
_data = new byte[64];
_dataSize = 0;
_totalLength = 0;
_abcd = new ABCDStruct();
//Intitial values as defined in RFC 1321
_abcd.A = 0x67452301;
_abcd.B = 0xefcdab89;
_abcd.C = 0x98badcfe;
_abcd.D = 0x10325476;
}
protected override void HashCore(byte[] array, int ibStart, int cbSize)
{
int startIndex = ibStart;
int totalArrayLength = _dataSize + cbSize;
if (totalArrayLength >= 64)
{
Array.Copy(array, startIndex, _data, _dataSize, 64 - _dataSize);
// Process message of 64 bytes (512 bits)
MD5Core.GetHashBlock(_data, ref _abcd, 0);
startIndex += 64 - _dataSize;
totalArrayLength -= 64;
while (totalArrayLength >= 64)
{
Array.Copy(array, startIndex, _data, 0, 64);
MD5Core.GetHashBlock(array, ref _abcd, startIndex);
totalArrayLength -= 64;
startIndex += 64;
}
_dataSize = totalArrayLength;
Array.Copy(array, startIndex, _data, 0, totalArrayLength);
}
else
{
Array.Copy(array, startIndex, _data, _dataSize, cbSize);
_dataSize = totalArrayLength;
}
_totalLength += cbSize;
}
protected override byte[] HashFinal()
{
base.HashValue = MD5Core.GetHashFinalBlock(_data, 0, _dataSize, _abcd, _totalLength * 8);
return base.HashValue;
}
}
} | 76 |
aws-sdk-net | aws | C# | //Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Text;
// **************************************************************
// * Raw implementation of the MD5 hash algorithm
// * from RFC 1321.
// *
// * Written By: Reid Borsuk and Jenny Zheng
// * Copyright (c) Microsoft Corporation. All rights reserved.
// **************************************************************
namespace ThirdParty.MD5
{
// Simple struct for the (a,b,c,d) which is used to compute the mesage digest.
internal struct ABCDStruct
{
public uint A;
public uint B;
public uint C;
public uint D;
}
internal sealed class MD5Core
{
//Prevent CSC from adding a default public constructor
private MD5Core() { }
public static byte[] GetHash(string input, Encoding encoding)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
if (null == encoding)
throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHash(string) overload to use UTF8 Encoding");
byte[] target = encoding.GetBytes(input);
return GetHash(target);
}
public static byte[] GetHash(string input)
{
return GetHash(input, new UTF8Encoding());
}
public static string GetHashString(byte[] input)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
string retval = BitConverter.ToString(GetHash(input));
retval = retval.Replace("-", "");
return retval;
}
public static string GetHashString(string input, Encoding encoding)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
if (null == encoding)
throw new System.ArgumentNullException("encoding", "Unable to calculate hash over a string without a default encoding. Consider using the GetHashString(string) overload to use UTF8 Encoding");
byte[] target = encoding.GetBytes(input);
return GetHashString(target);
}
public static string GetHashString(string input)
{
return GetHashString(input, new UTF8Encoding());
}
public static byte[] GetHash(byte[] input)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable to calculate hash over null input data");
//Intitial values defined in RFC 1321
ABCDStruct abcd = new ABCDStruct();
abcd.A = 0x67452301;
abcd.B = 0xefcdab89;
abcd.C = 0x98badcfe;
abcd.D = 0x10325476;
//We pass in the input array by block, the final block of data must be handled specialy for padding & length embeding
int startIndex = 0;
while (startIndex <= input.Length - 64)
{
MD5Core.GetHashBlock(input, ref abcd, startIndex);
startIndex += 64;
}
// The final data block.
return MD5Core.GetHashFinalBlock(input, startIndex, input.Length - startIndex, abcd, (Int64)input.Length * 8);
}
internal static byte[] GetHashFinalBlock(byte[] input, int ibStart, int cbSize, ABCDStruct ABCD, Int64 len)
{
byte[] working = new byte[64];
byte[] length = BitConverter.GetBytes(len);
//Padding is a single bit 1, followed by the number of 0s required to make size congruent to 448 modulo 512. Step 1 of RFC 1321
//The CLR ensures that our buffer is 0-assigned, we don't need to explicitly set it. This is why it ends up being quicker to just
//use a temporary array rather then doing in-place assignment (5% for small inputs)
Array.Copy(input, ibStart, working, 0, cbSize);
working[cbSize] = 0x80;
//We have enough room to store the length in this chunk
if (cbSize < 56)
{
Array.Copy(length, 0, working, 56, 8);
GetHashBlock(working, ref ABCD, 0);
}
else //We need an aditional chunk to store the length
{
GetHashBlock(working, ref ABCD, 0);
//Create an entirely new chunk due to the 0-assigned trick mentioned above, to avoid an extra function call clearing the array
working = new byte[64];
Array.Copy(length, 0, working, 56, 8);
GetHashBlock(working, ref ABCD, 0);
}
byte[] output = new byte[16];
Array.Copy(BitConverter.GetBytes(ABCD.A), 0, output, 0, 4);
Array.Copy(BitConverter.GetBytes(ABCD.B), 0, output, 4, 4);
Array.Copy(BitConverter.GetBytes(ABCD.C), 0, output, 8, 4);
Array.Copy(BitConverter.GetBytes(ABCD.D), 0, output, 12, 4);
return output;
}
// Performs a single block transform of MD5 for a given set of ABCD inputs
/* If implementing your own hashing framework, be sure to set the initial ABCD correctly according to RFC 1321:
// A = 0x67452301;
// B = 0xefcdab89;
// C = 0x98badcfe;
// D = 0x10325476;
*/
internal static void GetHashBlock(byte[] input, ref ABCDStruct ABCDValue, int ibStart)
{
uint[] temp = Converter(input, ibStart);
uint a = ABCDValue.A;
uint b = ABCDValue.B;
uint c = ABCDValue.C;
uint d = ABCDValue.D;
a = r1(a, b, c, d, temp[0], 7, 0xd76aa478);
d = r1(d, a, b, c, temp[1], 12, 0xe8c7b756);
c = r1(c, d, a, b, temp[2], 17, 0x242070db);
b = r1(b, c, d, a, temp[3], 22, 0xc1bdceee);
a = r1(a, b, c, d, temp[4], 7, 0xf57c0faf);
d = r1(d, a, b, c, temp[5], 12, 0x4787c62a);
c = r1(c, d, a, b, temp[6], 17, 0xa8304613);
b = r1(b, c, d, a, temp[7], 22, 0xfd469501);
a = r1(a, b, c, d, temp[8], 7, 0x698098d8);
d = r1(d, a, b, c, temp[9], 12, 0x8b44f7af);
c = r1(c, d, a, b, temp[10], 17, 0xffff5bb1);
b = r1(b, c, d, a, temp[11], 22, 0x895cd7be);
a = r1(a, b, c, d, temp[12], 7, 0x6b901122);
d = r1(d, a, b, c, temp[13], 12, 0xfd987193);
c = r1(c, d, a, b, temp[14], 17, 0xa679438e);
b = r1(b, c, d, a, temp[15], 22, 0x49b40821);
a = r2(a, b, c, d, temp[1], 5, 0xf61e2562);
d = r2(d, a, b, c, temp[6], 9, 0xc040b340);
c = r2(c, d, a, b, temp[11], 14, 0x265e5a51);
b = r2(b, c, d, a, temp[0], 20, 0xe9b6c7aa);
a = r2(a, b, c, d, temp[5], 5, 0xd62f105d);
d = r2(d, a, b, c, temp[10], 9, 0x02441453);
c = r2(c, d, a, b, temp[15], 14, 0xd8a1e681);
b = r2(b, c, d, a, temp[4], 20, 0xe7d3fbc8);
a = r2(a, b, c, d, temp[9], 5, 0x21e1cde6);
d = r2(d, a, b, c, temp[14], 9, 0xc33707d6);
c = r2(c, d, a, b, temp[3], 14, 0xf4d50d87);
b = r2(b, c, d, a, temp[8], 20, 0x455a14ed);
a = r2(a, b, c, d, temp[13], 5, 0xa9e3e905);
d = r2(d, a, b, c, temp[2], 9, 0xfcefa3f8);
c = r2(c, d, a, b, temp[7], 14, 0x676f02d9);
b = r2(b, c, d, a, temp[12], 20, 0x8d2a4c8a);
a = r3(a, b, c, d, temp[5], 4, 0xfffa3942);
d = r3(d, a, b, c, temp[8], 11, 0x8771f681);
c = r3(c, d, a, b, temp[11], 16, 0x6d9d6122);
b = r3(b, c, d, a, temp[14], 23, 0xfde5380c);
a = r3(a, b, c, d, temp[1], 4, 0xa4beea44);
d = r3(d, a, b, c, temp[4], 11, 0x4bdecfa9);
c = r3(c, d, a, b, temp[7], 16, 0xf6bb4b60);
b = r3(b, c, d, a, temp[10], 23, 0xbebfbc70);
a = r3(a, b, c, d, temp[13], 4, 0x289b7ec6);
d = r3(d, a, b, c, temp[0], 11, 0xeaa127fa);
c = r3(c, d, a, b, temp[3], 16, 0xd4ef3085);
b = r3(b, c, d, a, temp[6], 23, 0x04881d05);
a = r3(a, b, c, d, temp[9], 4, 0xd9d4d039);
d = r3(d, a, b, c, temp[12], 11, 0xe6db99e5);
c = r3(c, d, a, b, temp[15], 16, 0x1fa27cf8);
b = r3(b, c, d, a, temp[2], 23, 0xc4ac5665);
a = r4(a, b, c, d, temp[0], 6, 0xf4292244);
d = r4(d, a, b, c, temp[7], 10, 0x432aff97);
c = r4(c, d, a, b, temp[14], 15, 0xab9423a7);
b = r4(b, c, d, a, temp[5], 21, 0xfc93a039);
a = r4(a, b, c, d, temp[12], 6, 0x655b59c3);
d = r4(d, a, b, c, temp[3], 10, 0x8f0ccc92);
c = r4(c, d, a, b, temp[10], 15, 0xffeff47d);
b = r4(b, c, d, a, temp[1], 21, 0x85845dd1);
a = r4(a, b, c, d, temp[8], 6, 0x6fa87e4f);
d = r4(d, a, b, c, temp[15], 10, 0xfe2ce6e0);
c = r4(c, d, a, b, temp[6], 15, 0xa3014314);
b = r4(b, c, d, a, temp[13], 21, 0x4e0811a1);
a = r4(a, b, c, d, temp[4], 6, 0xf7537e82);
d = r4(d, a, b, c, temp[11], 10, 0xbd3af235);
c = r4(c, d, a, b, temp[2], 15, 0x2ad7d2bb);
b = r4(b, c, d, a, temp[9], 21, 0xeb86d391);
ABCDValue.A = unchecked(a + ABCDValue.A);
ABCDValue.B = unchecked(b + ABCDValue.B);
ABCDValue.C = unchecked(c + ABCDValue.C);
ABCDValue.D = unchecked(d + ABCDValue.D);
return;
}
//Manually unrolling these equations nets us a 20% performance improvement
private static uint r1(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + F(b, c, d) + x + t), s))
//F(x, y, z) ((x & y) | ((x ^ 0xFFFFFFFF) & z))
return unchecked(b + LSR((a + ((b & c) | ((b ^ 0xFFFFFFFF) & d)) + x + t), s));
}
private static uint r2(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + G(b, c, d) + x + t), s))
//G(x, y, z) ((x & z) | (y & (z ^ 0xFFFFFFFF)))
return unchecked(b + LSR((a + ((b & d) | (c & (d ^ 0xFFFFFFFF))) + x + t), s));
}
private static uint r3(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + H(b, c, d) + k + i), s))
//H(x, y, z) (x ^ y ^ z)
return unchecked(b + LSR((a + (b ^ c ^ d) + x + t), s));
}
private static uint r4(uint a, uint b, uint c, uint d, uint x, int s, uint t)
{
// (b + LSR((a + I(b, c, d) + k + i), s))
//I(x, y, z) (y ^ (x | (z ^ 0xFFFFFFFF)))
return unchecked(b + LSR((a + (c ^ (b | (d ^ 0xFFFFFFFF))) + x + t), s));
}
// Implementation of left rotate
// s is an int instead of a uint becuase the CLR requires the argument passed to >>/<< is of
// type int. Doing the demoting inside this function would add overhead.
private static uint LSR(uint i, int s)
{
return ((i << s) | (i >> (32 - s)));
}
//Convert input array into array of UInts
private static uint[] Converter(byte[] input, int ibStart)
{
if (null == input)
throw new System.ArgumentNullException("input", "Unable convert null array to array of uInts");
uint[] result = new uint[16];
for (int i = 0; i < 16; i++)
{
result[i] = (uint)input[ibStart + i * 4];
result[i] += (uint)input[ibStart + i * 4 + 1] << 8;
result[i] += (uint)input[ibStart + i * 4 + 2] << 16;
result[i] += (uint)input[ibStart + i * 4 + 3] << 24;
}
return result;
}
}
} | 278 |
aws-sdk-net | aws | C# | //Copyright (c) Microsoft Corporation. All rights reserved.
using System;
// **************************************************************
// * Raw implementation of the MD5 hash algorithm
// * from RFC 1321.
// *
// * Written By: Reid Borsuk and Jenny Zheng
// * Copyright (c) Microsoft Corporation. All rights reserved.
// **************************************************************
namespace ThirdParty.MD5
{
public class MD5Managed : System.Security.Cryptography.HashAlgorithm
{
private byte[] _data;
private ABCDStruct _abcd;
private Int64 _totalLength;
private int _dataSize;
public MD5Managed()
{
this.Initialize();
}
public override void Initialize()
{
_data = new byte[64];
_dataSize = 0;
_totalLength = 0;
_abcd = new ABCDStruct();
//Intitial values as defined in RFC 1321
_abcd.A = 0x67452301;
_abcd.B = 0xefcdab89;
_abcd.C = 0x98badcfe;
_abcd.D = 0x10325476;
}
public void TransformBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
HashCore(inputBuffer, inputOffset, inputCount);
}
public byte[] TransformFinalBlock(byte[] inputBuffer, int inputOffset, int inputCount)
{
HashCore(inputBuffer, inputOffset, inputCount);
var finalValue = HashFinal();
return finalValue;
}
protected override void HashCore(byte[] array, int ibStart, int cbSize)
{
int startIndex = ibStart;
int totalArrayLength = _dataSize + cbSize;
if (totalArrayLength >= 64)
{
Array.Copy(array, startIndex, _data, _dataSize, 64 - _dataSize);
// Process message of 64 bytes (512 bits)
MD5Core.GetHashBlock(_data, ref _abcd, 0);
startIndex += 64 - _dataSize;
totalArrayLength -= 64;
while (totalArrayLength >= 64)
{
Array.Copy(array, startIndex, _data, 0, 64);
MD5Core.GetHashBlock(array, ref _abcd, startIndex);
totalArrayLength -= 64;
startIndex += 64;
}
_dataSize = totalArrayLength;
Array.Copy(array, startIndex, _data, 0, totalArrayLength);
}
else
{
Array.Copy(array, startIndex, _data, _dataSize, cbSize);
_dataSize = totalArrayLength;
}
_totalLength += cbSize;
}
protected override byte[] HashFinal()
{
var finalValue = MD5Core.GetHashFinalBlock(_data, 0, _dataSize, _abcd, _totalLength * 8);
return finalValue;
}
}
} | 87 |
aws-sdk-net | aws | 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.
* *****************************************************************************
* __ _ _ ___
* ( )( \/\/ )/ __)
* /__\ \ / \__ \
* (_)(_) \/\/ (___/
*
* AWS SDK for .NET
*
*/
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using Amazon.Runtime.Internal.Util;
using Amazon.Util;
using System.Xml;
using System.Reflection;
using System.Text;
namespace Amazon
{
/// <summary>
/// Configuration options that apply to the entire SDK.
/// </summary>
public static partial class AWSConfigs
{
#region ApplicationName
/// <summary>
/// The unique application name for the current application. This values is currently used
/// by high level APIs (Mobile Analytics Manager and Cognito Sync Manager) to create a unique file
/// path to store local database files.
/// Changes to this setting will only take effect in newly-constructed objects using this property.
/// <code>
/// <configSections>
/// <section name="aws" type="Amazon.AWSSection, AWSSDK.Core"/>
/// </configSections>
/// <aws applicationName="" />
/// </code>
/// </summary>
public static string ApplicationName
{
get { return _rootConfig.ApplicationName; }
set { _rootConfig.ApplicationName = value; }
}
#endregion
#region Config
public static string GetConfig(string name)
{
NameValueCollection appConfig = ConfigurationManager.AppSettings;
if (appConfig == null)
return null;
string value = appConfig[name];
return value;
}
internal static T GetSection<T>(string sectionName)
where T : class, new()
{
object section = ConfigurationManager.GetSection(sectionName);
if (section == null)
return new T();
return section as T;
}
internal static bool XmlSectionExists(string sectionName)
{
var section = ConfigurationManager.GetSection(sectionName);
var element = section as System.Xml.XmlElement;
return (element != null);
}
#endregion
#region TraceListeners
private static Dictionary<string, List<TraceListener>> _traceListeners
= new Dictionary<string, List<TraceListener>>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Add a listener for SDK logging.
/// </summary>
/// <remarks>If the listener does not have a name, you will not be able to remove it later.</remarks>
/// <param name="source">The source to log for, e.g. "Amazon", or "Amazon.DynamoDB".</param>
/// <param name="listener">The listener to add.</param>
public static void AddTraceListener(string source, TraceListener listener)
{
if (string.IsNullOrEmpty(source))
throw new ArgumentException("Source cannot be null or empty", "source");
if (null == listener)
throw new ArgumentException("Listener cannot be null", "listener");
lock (_traceListeners)
{
if (!_traceListeners.ContainsKey(source))
_traceListeners.Add(source, new List<TraceListener>());
_traceListeners[source].Add(listener);
}
Logger.ClearLoggerCache();
}
/// <summary>
/// Remove a trace listener from SDK logging.
/// </summary>
/// <param name="source">The source the listener was added to.</param>
/// <param name="name">The name of the listener.</param>
public static void RemoveTraceListener(string source, string name)
{
if (string.IsNullOrEmpty(source))
throw new ArgumentException("Source cannot be null or empty", "source");
if (string.IsNullOrEmpty(name))
throw new ArgumentException("Name cannot be null or empty", "name");
lock (_traceListeners)
{
if (_traceListeners.ContainsKey(source))
{
foreach (var l in _traceListeners[source])
{
if (l.Name.Equals(name, StringComparison.Ordinal))
{
_traceListeners[source].Remove(l);
break;
}
}
}
}
Logger.ClearLoggerCache();
}
// Used by Logger.Diagnostic to add listeners to TraceSources when loggers
// are created.
internal static TraceListener[] TraceListeners(string source)
{
lock (_traceListeners)
{
List<TraceListener> temp;
if (_traceListeners.TryGetValue(source, out temp))
{
return temp.ToArray();
}
return new TraceListener[0];
}
}
#endregion
#region Generate Config Template
/// <summary>
/// Generates a sample XML representation of the SDK configuration section.
/// </summary>
/// <remarks>
/// The XML returned has an example of every tag in the SDK configuration
/// section, and sample input for each attribute. This can be included in
/// an App.config or Web.config and edited to suit. Where a section contains
/// a collection, multiple of the same tag will be output.
/// </remarks>
/// <returns>Sample XML configuration string.</returns>
public static string GenerateConfigTemplate()
{
Assembly a = typeof(AWSConfigs).Assembly;
Type t = a.GetType("Amazon.AWSSection");
var xmlSettings = new XmlWriterSettings
{
OmitXmlDeclaration = true,
Indent = true,
IndentChars = " ",
NewLineOnAttributes = true,
NewLineChars = "\n"
};
var sb = new StringBuilder();
using (var xml = XmlWriter.Create(sb, xmlSettings))
{
FormatConfigSection(t, xml, tag: "aws");
}
return sb.ToString();
}
private static void FormatConfigSection(Type section, XmlWriter xml, string tag = null)
{
var props = section.GetProperties(
BindingFlags.Instance |
BindingFlags.Public |
BindingFlags.DeclaredOnly);
var attrs = props.Where(p => !IsConfigurationElement(p)).ToList();
var subsections = props.Where(p => IsConfigurationElement(p)
&& !IsConfigurationElementCollection(p)).ToList();
var collections = props.Where(p => IsConfigurationElementCollection(p)).ToList();
xml.WriteStartElement(tag);
foreach (var prop in attrs)
{
var name = ConfigurationPropertyName(prop);
xml.WriteAttributeString(name, GetExampleForType(prop));
}
foreach (var prop in subsections)
{
var sectionName = ConfigurationPropertyName(prop);
if (!string.IsNullOrEmpty(sectionName))
FormatConfigSection(prop.PropertyType, xml, sectionName);
}
foreach (var coll in collections)
{
FormatConfigurationListItems(coll, xml);
}
xml.WriteEndElement();
}
private static string GetExampleForType(PropertyInfo prop)
{
if (prop.PropertyType.Equals(typeof(bool?)))
return "true | false";
if (prop.PropertyType.Equals(typeof(int?)))
return "1234";
if (prop.PropertyType.Equals(typeof(String)))
return "string value";
if (prop.PropertyType.Equals(typeof(Type)))
return "NameSpace.Class, Assembly";
if (prop.PropertyType.IsEnum)
{
var members = Enum.GetNames(prop.PropertyType);
var separator = IsFlagsEnum(prop) ? ", " : " | ";
return string.Join(separator, members.ToArray());
}
return "( " + prop.PropertyType.FullName + " )";
}
private static void FormatConfigurationListItems(PropertyInfo section, XmlWriter xml)
{
var sectionName = ConfigurationPropertyName(section);
var itemType = TypeOfConfigurationCollectionItem(section);
var item = Activator.CreateInstance(section.PropertyType);
var nameProperty = section.PropertyType.GetProperty("ItemPropertyName",
BindingFlags.NonPublic | BindingFlags.Instance);
var itemTagName = nameProperty.GetValue(item, null).ToString();
FormatConfigSection(itemType, xml, itemTagName);
FormatConfigSection(itemType, xml, itemTagName);
}
private static bool IsFlagsEnum(PropertyInfo prop)
{
return prop.PropertyType.GetCustomAttributes(typeof(FlagsAttribute), false).Any();
}
private static bool IsConfigurationElement(PropertyInfo prop)
{
return typeof(ConfigurationElement).IsAssignableFrom(prop.PropertyType);
}
private static bool IsConfigurationElementCollection(PropertyInfo prop)
{
return typeof(ConfigurationElementCollection).IsAssignableFrom(prop.PropertyType);
}
private static Type TypeOfConfigurationCollectionItem(PropertyInfo prop)
{
var configCollAttr = prop.PropertyType
.GetCustomAttributes(typeof(ConfigurationCollectionAttribute), false)
.First();
return ((ConfigurationCollectionAttribute)configCollAttr).ItemType;
}
private static string ConfigurationPropertyName(PropertyInfo prop)
{
var configAttr = prop.GetCustomAttributes(typeof(ConfigurationPropertyAttribute), false)
.FirstOrDefault() as ConfigurationPropertyAttribute;
return null == configAttr ? prop.Name : configAttr.Name;
}
#endregion
}
}
| 309 |
aws-sdk-net | aws | 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.
* *****************************************************************************
* __ _ _ ___
* ( )( \/\/ )/ __)
* /__\ \ / \__ \
* (_)(_) \/\/ (___/
*
* AWS SDK for .NET
*
*/
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Diagnostics;
using Amazon.Runtime;
using Amazon.Runtime.Internal.Util;
using Amazon.Util;
namespace Amazon
{
/// <summary>
/// Configuration options that apply to the entire SDK.
/// </summary>
public static partial class AWSConfigs
{
public static string GetConfig(string name)
{
return null;
}
internal static bool XmlSectionExists(string sectionName)
{
return false;
}
public static HttpClientFactory HttpClientFactory { get; set; }
#region TraceListeners
private static Dictionary<string, List<TraceListener>> _traceListeners
= new Dictionary<string, List<TraceListener>>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Add a listener for SDK logging.
/// </summary>
/// <remarks>If the listener does not have a name, you will not be able to remove it later.</remarks>
/// <param name="source">The source to log for, e.g. "Amazon", or "Amazon.DynamoDB".</param>
/// <param name="listener">The listener to add.</param>
public static void AddTraceListener(string source, TraceListener listener)
{
if (string.IsNullOrEmpty(source))
throw new ArgumentException("Source cannot be null or empty", "source");
if (null == listener)
throw new ArgumentException("Listener cannot be null", "listener");
lock (_traceListeners)
{
if (!_traceListeners.ContainsKey(source))
_traceListeners.Add(source, new List<TraceListener>());
_traceListeners[source].Add(listener);
}
Logger.ClearLoggerCache();
}
/// <summary>
/// Remove a trace listener from SDK logging.
/// </summary>
/// <param name="source">The source the listener was added to.</param>
/// <param name="name">The name of the listener.</param>
public static void RemoveTraceListener(string source, string name)
{
if (string.IsNullOrEmpty(source))
throw new ArgumentException("Source cannot be null or empty", "source");
if (string.IsNullOrEmpty(name))
throw new ArgumentException("Name cannot be null or empty", "name");
lock (_traceListeners)
{
if (_traceListeners.ContainsKey(source))
{
foreach (var l in _traceListeners[source])
{
if (l.Name.Equals(name, StringComparison.Ordinal))
{
_traceListeners[source].Remove(l);
break;
}
}
}
}
Logger.ClearLoggerCache();
}
// Used by Logger.Diagnostic to add listeners to TraceSources when loggers
// are created.
internal static TraceListener[] TraceListeners(string source)
{
lock (_traceListeners)
{
List<TraceListener> temp;
if (_traceListeners.TryGetValue(source, out temp))
{
return temp.ToArray();
}
return new TraceListener[0];
}
}
#endregion
}
}
| 126 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Util.Internal;
using Amazon.AccessAnalyzer.Internal;
namespace Amazon.AccessAnalyzer
{
/// <summary>
/// Configuration for accessing Amazon AccessAnalyzer service
/// </summary>
[AWSSignerType("v4")]
public partial class AmazonAccessAnalyzerConfig : ClientConfig
{
private static readonly string UserAgentString =
InternalSDKUtils.BuildUserAgentString("3.7.103.84");
private string _userAgent = UserAgentString;
/// <summary>
/// Default constructor
/// </summary>
public AmazonAccessAnalyzerConfig()
: base(new Amazon.Runtime.Internal.DefaultConfigurationProvider(AmazonAccessAnalyzerDefaultConfiguration.GetAllConfigurations()))
{
this.AuthenticationServiceName = "access-analyzer";
this.EndpointProvider = new AmazonAccessAnalyzerEndpointProvider();
}
/// <summary>
/// The constant used to lookup in the region hash the endpoint.
/// </summary>
public override string RegionEndpointServiceName
{
get
{
return "access-analyzer";
}
}
/// <summary>
/// Gets the ServiceVersion property.
/// </summary>
public override string ServiceVersion
{
get
{
return "2019-11-01";
}
}
/// <summary>
/// Gets the value of UserAgent property.
/// </summary>
public override string UserAgent
{
get
{
return _userAgent;
}
}
}
} | 83 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Amazon.Runtime;
namespace Amazon.AccessAnalyzer
{
/// <summary>
/// Configuration for accessing Amazon AccessAnalyzer service
/// </summary>
public static class AmazonAccessAnalyzerDefaultConfiguration
{
/// <summary>
/// Collection of all <see cref="DefaultConfiguration"/>s supported by
/// AccessAnalyzer
/// </summary>
public static ReadOnlyCollection<IDefaultConfiguration> GetAllConfigurations()
{
return new ReadOnlyCollection<IDefaultConfiguration>(new List<IDefaultConfiguration>
{
Standard,
InRegion,
CrossRegion,
Mobile,
Auto,
Legacy
});
}
/// <summary>
/// <p>The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration Standard {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Standard,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:03.1
ConnectTimeout = TimeSpan.FromMilliseconds(3100L),
// 0:00:03.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(3100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration InRegion {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.InRegion,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:01.1
ConnectTimeout = TimeSpan.FromMilliseconds(1100L),
// 0:00:01.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(1100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration CrossRegion {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.CrossRegion,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:03.1
ConnectTimeout = TimeSpan.FromMilliseconds(3100L),
// 0:00:03.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(3100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications</p><p>Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK</p>
/// </summary>
public static IDefaultConfiguration Mobile {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Mobile,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:30
ConnectTimeout = TimeSpan.FromMilliseconds(30000L),
// 0:00:30
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(30000L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.</p><p>Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">EC2 Instance Metadata service</a>, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application</p>
/// </summary>
public static IDefaultConfiguration Auto {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Auto,
RetryMode = RequestRetryMode.Standard,
StsRegionalEndpoints = StsRegionalEndpointsValue.Regional,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Regional,
// 0:00:01.1
ConnectTimeout = TimeSpan.FromMilliseconds(1100L),
// 0:00:01.1
TlsNegotiationTimeout = TimeSpan.FromMilliseconds(1100L),
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
/// <summary>
/// <p>The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode</p>
/// </summary>
public static IDefaultConfiguration Legacy {get;} = new DefaultConfiguration
{
Name = DefaultConfigurationMode.Legacy,
RetryMode = RequestRetryMode.Legacy,
StsRegionalEndpoints = StsRegionalEndpointsValue.Legacy,
S3UsEast1RegionalEndpoint = S3UsEast1RegionalEndpointValue.Legacy,
ConnectTimeout = null,
TlsNegotiationTimeout = null,
TimeToFirstByteTimeout = null,
HttpRequestTimeout = null
};
}
} | 146 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using Amazon.Runtime;
using Amazon.Runtime.Endpoints;
namespace Amazon.AccessAnalyzer.Endpoints
{
/// <summary>
/// Contains parameters used for resolving AccessAnalyzer endpoints
/// Parameters can be sourced from client config and service operations
/// Used by internal AccessAnalyzerEndpointProvider and AccessAnalyzerEndpointResolver
/// Can be used by custom EndpointProvider, see ClientConfig.EndpointProvider
/// </summary>
public class AccessAnalyzerEndpointParameters : EndpointParameters
{
/// <summary>
/// AccessAnalyzerEndpointParameters constructor
/// </summary>
public AccessAnalyzerEndpointParameters()
{
UseDualStack = false;
UseFIPS = false;
}
/// <summary>
/// Region parameter
/// </summary>
public string Region
{
get { return (string)this["Region"]; }
set { this["Region"] = value; }
}
/// <summary>
/// UseDualStack parameter
/// </summary>
public bool? UseDualStack
{
get { return (bool?)this["UseDualStack"]; }
set { this["UseDualStack"] = value; }
}
/// <summary>
/// UseFIPS parameter
/// </summary>
public bool? UseFIPS
{
get { return (bool?)this["UseFIPS"]; }
set { this["UseFIPS"] = value; }
}
/// <summary>
/// Endpoint parameter
/// </summary>
public string Endpoint
{
get { return (string)this["Endpoint"]; }
set { this["Endpoint"] = value; }
}
}
} | 78 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using Amazon.Runtime;
namespace Amazon.AccessAnalyzer
{
///<summary>
/// Common exception for the AccessAnalyzer service.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class AmazonAccessAnalyzerException : AmazonServiceException
{
/// <summary>
/// Construct instance of AmazonAccessAnalyzerException
/// </summary>
/// <param name="message"></param>
public AmazonAccessAnalyzerException(string message)
: base(message)
{
}
/// <summary>
/// Construct instance of AmazonAccessAnalyzerException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public AmazonAccessAnalyzerException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Construct instance of AmazonAccessAnalyzerException
/// </summary>
/// <param name="innerException"></param>
public AmazonAccessAnalyzerException(Exception innerException)
: base(innerException.Message, innerException)
{
}
/// <summary>
/// Construct instance of AmazonAccessAnalyzerException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AmazonAccessAnalyzerException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode)
{
}
/// <summary>
/// Construct instance of AmazonAccessAnalyzerException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AmazonAccessAnalyzerException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode)
{
}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the AmazonAccessAnalyzerException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected AmazonAccessAnalyzerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}
#endif
}
} | 105 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using Amazon.Runtime;
namespace Amazon.AccessAnalyzer
{
/// <summary>
/// Constants used for properties of type AccessPreviewStatus.
/// </summary>
public class AccessPreviewStatus : ConstantClass
{
/// <summary>
/// Constant COMPLETED for AccessPreviewStatus
/// </summary>
public static readonly AccessPreviewStatus COMPLETED = new AccessPreviewStatus("COMPLETED");
/// <summary>
/// Constant CREATING for AccessPreviewStatus
/// </summary>
public static readonly AccessPreviewStatus CREATING = new AccessPreviewStatus("CREATING");
/// <summary>
/// Constant FAILED for AccessPreviewStatus
/// </summary>
public static readonly AccessPreviewStatus FAILED = new AccessPreviewStatus("FAILED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public AccessPreviewStatus(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static AccessPreviewStatus FindValue(string value)
{
return FindValue<AccessPreviewStatus>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator AccessPreviewStatus(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type AccessPreviewStatusReasonCode.
/// </summary>
public class AccessPreviewStatusReasonCode : ConstantClass
{
/// <summary>
/// Constant INTERNAL_ERROR for AccessPreviewStatusReasonCode
/// </summary>
public static readonly AccessPreviewStatusReasonCode INTERNAL_ERROR = new AccessPreviewStatusReasonCode("INTERNAL_ERROR");
/// <summary>
/// Constant INVALID_CONFIGURATION for AccessPreviewStatusReasonCode
/// </summary>
public static readonly AccessPreviewStatusReasonCode INVALID_CONFIGURATION = new AccessPreviewStatusReasonCode("INVALID_CONFIGURATION");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public AccessPreviewStatusReasonCode(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static AccessPreviewStatusReasonCode FindValue(string value)
{
return FindValue<AccessPreviewStatusReasonCode>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator AccessPreviewStatusReasonCode(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type AclPermission.
/// </summary>
public class AclPermission : ConstantClass
{
/// <summary>
/// Constant FULL_CONTROL for AclPermission
/// </summary>
public static readonly AclPermission FULL_CONTROL = new AclPermission("FULL_CONTROL");
/// <summary>
/// Constant READ for AclPermission
/// </summary>
public static readonly AclPermission READ = new AclPermission("READ");
/// <summary>
/// Constant READ_ACP for AclPermission
/// </summary>
public static readonly AclPermission READ_ACP = new AclPermission("READ_ACP");
/// <summary>
/// Constant WRITE for AclPermission
/// </summary>
public static readonly AclPermission WRITE = new AclPermission("WRITE");
/// <summary>
/// Constant WRITE_ACP for AclPermission
/// </summary>
public static readonly AclPermission WRITE_ACP = new AclPermission("WRITE_ACP");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public AclPermission(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static AclPermission FindValue(string value)
{
return FindValue<AclPermission>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator AclPermission(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type AnalyzerStatus.
/// </summary>
public class AnalyzerStatus : ConstantClass
{
/// <summary>
/// Constant ACTIVE for AnalyzerStatus
/// </summary>
public static readonly AnalyzerStatus ACTIVE = new AnalyzerStatus("ACTIVE");
/// <summary>
/// Constant CREATING for AnalyzerStatus
/// </summary>
public static readonly AnalyzerStatus CREATING = new AnalyzerStatus("CREATING");
/// <summary>
/// Constant DISABLED for AnalyzerStatus
/// </summary>
public static readonly AnalyzerStatus DISABLED = new AnalyzerStatus("DISABLED");
/// <summary>
/// Constant FAILED for AnalyzerStatus
/// </summary>
public static readonly AnalyzerStatus FAILED = new AnalyzerStatus("FAILED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public AnalyzerStatus(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static AnalyzerStatus FindValue(string value)
{
return FindValue<AnalyzerStatus>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator AnalyzerStatus(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type FindingChangeType.
/// </summary>
public class FindingChangeType : ConstantClass
{
/// <summary>
/// Constant CHANGED for FindingChangeType
/// </summary>
public static readonly FindingChangeType CHANGED = new FindingChangeType("CHANGED");
/// <summary>
/// Constant NEW for FindingChangeType
/// </summary>
public static readonly FindingChangeType NEW = new FindingChangeType("NEW");
/// <summary>
/// Constant UNCHANGED for FindingChangeType
/// </summary>
public static readonly FindingChangeType UNCHANGED = new FindingChangeType("UNCHANGED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public FindingChangeType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static FindingChangeType FindValue(string value)
{
return FindValue<FindingChangeType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator FindingChangeType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type FindingSourceType.
/// </summary>
public class FindingSourceType : ConstantClass
{
/// <summary>
/// Constant BUCKET_ACL for FindingSourceType
/// </summary>
public static readonly FindingSourceType BUCKET_ACL = new FindingSourceType("BUCKET_ACL");
/// <summary>
/// Constant POLICY for FindingSourceType
/// </summary>
public static readonly FindingSourceType POLICY = new FindingSourceType("POLICY");
/// <summary>
/// Constant S3_ACCESS_POINT for FindingSourceType
/// </summary>
public static readonly FindingSourceType S3_ACCESS_POINT = new FindingSourceType("S3_ACCESS_POINT");
/// <summary>
/// Constant S3_ACCESS_POINT_ACCOUNT for FindingSourceType
/// </summary>
public static readonly FindingSourceType S3_ACCESS_POINT_ACCOUNT = new FindingSourceType("S3_ACCESS_POINT_ACCOUNT");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public FindingSourceType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static FindingSourceType FindValue(string value)
{
return FindValue<FindingSourceType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator FindingSourceType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type FindingStatus.
/// </summary>
public class FindingStatus : ConstantClass
{
/// <summary>
/// Constant ACTIVE for FindingStatus
/// </summary>
public static readonly FindingStatus ACTIVE = new FindingStatus("ACTIVE");
/// <summary>
/// Constant ARCHIVED for FindingStatus
/// </summary>
public static readonly FindingStatus ARCHIVED = new FindingStatus("ARCHIVED");
/// <summary>
/// Constant RESOLVED for FindingStatus
/// </summary>
public static readonly FindingStatus RESOLVED = new FindingStatus("RESOLVED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public FindingStatus(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static FindingStatus FindValue(string value)
{
return FindValue<FindingStatus>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator FindingStatus(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type FindingStatusUpdate.
/// </summary>
public class FindingStatusUpdate : ConstantClass
{
/// <summary>
/// Constant ACTIVE for FindingStatusUpdate
/// </summary>
public static readonly FindingStatusUpdate ACTIVE = new FindingStatusUpdate("ACTIVE");
/// <summary>
/// Constant ARCHIVED for FindingStatusUpdate
/// </summary>
public static readonly FindingStatusUpdate ARCHIVED = new FindingStatusUpdate("ARCHIVED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public FindingStatusUpdate(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static FindingStatusUpdate FindValue(string value)
{
return FindValue<FindingStatusUpdate>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator FindingStatusUpdate(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type JobErrorCode.
/// </summary>
public class JobErrorCode : ConstantClass
{
/// <summary>
/// Constant AUTHORIZATION_ERROR for JobErrorCode
/// </summary>
public static readonly JobErrorCode AUTHORIZATION_ERROR = new JobErrorCode("AUTHORIZATION_ERROR");
/// <summary>
/// Constant RESOURCE_NOT_FOUND_ERROR for JobErrorCode
/// </summary>
public static readonly JobErrorCode RESOURCE_NOT_FOUND_ERROR = new JobErrorCode("RESOURCE_NOT_FOUND_ERROR");
/// <summary>
/// Constant SERVICE_ERROR for JobErrorCode
/// </summary>
public static readonly JobErrorCode SERVICE_ERROR = new JobErrorCode("SERVICE_ERROR");
/// <summary>
/// Constant SERVICE_QUOTA_EXCEEDED_ERROR for JobErrorCode
/// </summary>
public static readonly JobErrorCode SERVICE_QUOTA_EXCEEDED_ERROR = new JobErrorCode("SERVICE_QUOTA_EXCEEDED_ERROR");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public JobErrorCode(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static JobErrorCode FindValue(string value)
{
return FindValue<JobErrorCode>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator JobErrorCode(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type JobStatus.
/// </summary>
public class JobStatus : ConstantClass
{
/// <summary>
/// Constant CANCELED for JobStatus
/// </summary>
public static readonly JobStatus CANCELED = new JobStatus("CANCELED");
/// <summary>
/// Constant FAILED for JobStatus
/// </summary>
public static readonly JobStatus FAILED = new JobStatus("FAILED");
/// <summary>
/// Constant IN_PROGRESS for JobStatus
/// </summary>
public static readonly JobStatus IN_PROGRESS = new JobStatus("IN_PROGRESS");
/// <summary>
/// Constant SUCCEEDED for JobStatus
/// </summary>
public static readonly JobStatus SUCCEEDED = new JobStatus("SUCCEEDED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public JobStatus(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static JobStatus FindValue(string value)
{
return FindValue<JobStatus>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator JobStatus(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type KmsGrantOperation.
/// </summary>
public class KmsGrantOperation : ConstantClass
{
/// <summary>
/// Constant CreateGrant for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation CreateGrant = new KmsGrantOperation("CreateGrant");
/// <summary>
/// Constant Decrypt for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation Decrypt = new KmsGrantOperation("Decrypt");
/// <summary>
/// Constant DescribeKey for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation DescribeKey = new KmsGrantOperation("DescribeKey");
/// <summary>
/// Constant Encrypt for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation Encrypt = new KmsGrantOperation("Encrypt");
/// <summary>
/// Constant GenerateDataKey for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation GenerateDataKey = new KmsGrantOperation("GenerateDataKey");
/// <summary>
/// Constant GenerateDataKeyPair for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation GenerateDataKeyPair = new KmsGrantOperation("GenerateDataKeyPair");
/// <summary>
/// Constant GenerateDataKeyPairWithoutPlaintext for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation GenerateDataKeyPairWithoutPlaintext = new KmsGrantOperation("GenerateDataKeyPairWithoutPlaintext");
/// <summary>
/// Constant GenerateDataKeyWithoutPlaintext for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation GenerateDataKeyWithoutPlaintext = new KmsGrantOperation("GenerateDataKeyWithoutPlaintext");
/// <summary>
/// Constant GetPublicKey for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation GetPublicKey = new KmsGrantOperation("GetPublicKey");
/// <summary>
/// Constant ReEncryptFrom for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation ReEncryptFrom = new KmsGrantOperation("ReEncryptFrom");
/// <summary>
/// Constant ReEncryptTo for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation ReEncryptTo = new KmsGrantOperation("ReEncryptTo");
/// <summary>
/// Constant RetireGrant for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation RetireGrant = new KmsGrantOperation("RetireGrant");
/// <summary>
/// Constant Sign for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation Sign = new KmsGrantOperation("Sign");
/// <summary>
/// Constant Verify for KmsGrantOperation
/// </summary>
public static readonly KmsGrantOperation Verify = new KmsGrantOperation("Verify");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public KmsGrantOperation(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static KmsGrantOperation FindValue(string value)
{
return FindValue<KmsGrantOperation>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator KmsGrantOperation(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type Locale.
/// </summary>
public class Locale : ConstantClass
{
/// <summary>
/// Constant DE for Locale
/// </summary>
public static readonly Locale DE = new Locale("DE");
/// <summary>
/// Constant EN for Locale
/// </summary>
public static readonly Locale EN = new Locale("EN");
/// <summary>
/// Constant ES for Locale
/// </summary>
public static readonly Locale ES = new Locale("ES");
/// <summary>
/// Constant FR for Locale
/// </summary>
public static readonly Locale FR = new Locale("FR");
/// <summary>
/// Constant IT for Locale
/// </summary>
public static readonly Locale IT = new Locale("IT");
/// <summary>
/// Constant JA for Locale
/// </summary>
public static readonly Locale JA = new Locale("JA");
/// <summary>
/// Constant KO for Locale
/// </summary>
public static readonly Locale KO = new Locale("KO");
/// <summary>
/// Constant PT_BR for Locale
/// </summary>
public static readonly Locale PT_BR = new Locale("PT_BR");
/// <summary>
/// Constant ZH_CN for Locale
/// </summary>
public static readonly Locale ZH_CN = new Locale("ZH_CN");
/// <summary>
/// Constant ZH_TW for Locale
/// </summary>
public static readonly Locale ZH_TW = new Locale("ZH_TW");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public Locale(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static Locale FindValue(string value)
{
return FindValue<Locale>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator Locale(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type OrderBy.
/// </summary>
public class OrderBy : ConstantClass
{
/// <summary>
/// Constant ASC for OrderBy
/// </summary>
public static readonly OrderBy ASC = new OrderBy("ASC");
/// <summary>
/// Constant DESC for OrderBy
/// </summary>
public static readonly OrderBy DESC = new OrderBy("DESC");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public OrderBy(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static OrderBy FindValue(string value)
{
return FindValue<OrderBy>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator OrderBy(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type PolicyType.
/// </summary>
public class PolicyType : ConstantClass
{
/// <summary>
/// Constant IDENTITY_POLICY for PolicyType
/// </summary>
public static readonly PolicyType IDENTITY_POLICY = new PolicyType("IDENTITY_POLICY");
/// <summary>
/// Constant RESOURCE_POLICY for PolicyType
/// </summary>
public static readonly PolicyType RESOURCE_POLICY = new PolicyType("RESOURCE_POLICY");
/// <summary>
/// Constant SERVICE_CONTROL_POLICY for PolicyType
/// </summary>
public static readonly PolicyType SERVICE_CONTROL_POLICY = new PolicyType("SERVICE_CONTROL_POLICY");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public PolicyType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static PolicyType FindValue(string value)
{
return FindValue<PolicyType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator PolicyType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type ReasonCode.
/// </summary>
public class ReasonCode : ConstantClass
{
/// <summary>
/// Constant AWS_SERVICE_ACCESS_DISABLED for ReasonCode
/// </summary>
public static readonly ReasonCode AWS_SERVICE_ACCESS_DISABLED = new ReasonCode("AWS_SERVICE_ACCESS_DISABLED");
/// <summary>
/// Constant DELEGATED_ADMINISTRATOR_DEREGISTERED for ReasonCode
/// </summary>
public static readonly ReasonCode DELEGATED_ADMINISTRATOR_DEREGISTERED = new ReasonCode("DELEGATED_ADMINISTRATOR_DEREGISTERED");
/// <summary>
/// Constant ORGANIZATION_DELETED for ReasonCode
/// </summary>
public static readonly ReasonCode ORGANIZATION_DELETED = new ReasonCode("ORGANIZATION_DELETED");
/// <summary>
/// Constant SERVICE_LINKED_ROLE_CREATION_FAILED for ReasonCode
/// </summary>
public static readonly ReasonCode SERVICE_LINKED_ROLE_CREATION_FAILED = new ReasonCode("SERVICE_LINKED_ROLE_CREATION_FAILED");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ReasonCode(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ReasonCode FindValue(string value)
{
return FindValue<ReasonCode>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ReasonCode(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type ResourceType.
/// </summary>
public class ResourceType : ConstantClass
{
/// <summary>
/// Constant AWSEC2Snapshot for ResourceType
/// </summary>
public static readonly ResourceType AWSEC2Snapshot = new ResourceType("AWS::EC2::Snapshot");
/// <summary>
/// Constant AWSECRRepository for ResourceType
/// </summary>
public static readonly ResourceType AWSECRRepository = new ResourceType("AWS::ECR::Repository");
/// <summary>
/// Constant AWSEFSFileSystem for ResourceType
/// </summary>
public static readonly ResourceType AWSEFSFileSystem = new ResourceType("AWS::EFS::FileSystem");
/// <summary>
/// Constant AWSIAMRole for ResourceType
/// </summary>
public static readonly ResourceType AWSIAMRole = new ResourceType("AWS::IAM::Role");
/// <summary>
/// Constant AWSKMSKey for ResourceType
/// </summary>
public static readonly ResourceType AWSKMSKey = new ResourceType("AWS::KMS::Key");
/// <summary>
/// Constant AWSLambdaFunction for ResourceType
/// </summary>
public static readonly ResourceType AWSLambdaFunction = new ResourceType("AWS::Lambda::Function");
/// <summary>
/// Constant AWSLambdaLayerVersion for ResourceType
/// </summary>
public static readonly ResourceType AWSLambdaLayerVersion = new ResourceType("AWS::Lambda::LayerVersion");
/// <summary>
/// Constant AWSRDSDBClusterSnapshot for ResourceType
/// </summary>
public static readonly ResourceType AWSRDSDBClusterSnapshot = new ResourceType("AWS::RDS::DBClusterSnapshot");
/// <summary>
/// Constant AWSRDSDBSnapshot for ResourceType
/// </summary>
public static readonly ResourceType AWSRDSDBSnapshot = new ResourceType("AWS::RDS::DBSnapshot");
/// <summary>
/// Constant AWSS3Bucket for ResourceType
/// </summary>
public static readonly ResourceType AWSS3Bucket = new ResourceType("AWS::S3::Bucket");
/// <summary>
/// Constant AWSSecretsManagerSecret for ResourceType
/// </summary>
public static readonly ResourceType AWSSecretsManagerSecret = new ResourceType("AWS::SecretsManager::Secret");
/// <summary>
/// Constant AWSSNSTopic for ResourceType
/// </summary>
public static readonly ResourceType AWSSNSTopic = new ResourceType("AWS::SNS::Topic");
/// <summary>
/// Constant AWSSQSQueue for ResourceType
/// </summary>
public static readonly ResourceType AWSSQSQueue = new ResourceType("AWS::SQS::Queue");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ResourceType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ResourceType FindValue(string value)
{
return FindValue<ResourceType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ResourceType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type Type.
/// </summary>
public class Type : ConstantClass
{
/// <summary>
/// Constant ACCOUNT for Type
/// </summary>
public static readonly Type ACCOUNT = new Type("ACCOUNT");
/// <summary>
/// Constant ORGANIZATION for Type
/// </summary>
public static readonly Type ORGANIZATION = new Type("ORGANIZATION");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public Type(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static Type FindValue(string value)
{
return FindValue<Type>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator Type(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type ValidatePolicyFindingType.
/// </summary>
public class ValidatePolicyFindingType : ConstantClass
{
/// <summary>
/// Constant ERROR for ValidatePolicyFindingType
/// </summary>
public static readonly ValidatePolicyFindingType ERROR = new ValidatePolicyFindingType("ERROR");
/// <summary>
/// Constant SECURITY_WARNING for ValidatePolicyFindingType
/// </summary>
public static readonly ValidatePolicyFindingType SECURITY_WARNING = new ValidatePolicyFindingType("SECURITY_WARNING");
/// <summary>
/// Constant SUGGESTION for ValidatePolicyFindingType
/// </summary>
public static readonly ValidatePolicyFindingType SUGGESTION = new ValidatePolicyFindingType("SUGGESTION");
/// <summary>
/// Constant WARNING for ValidatePolicyFindingType
/// </summary>
public static readonly ValidatePolicyFindingType WARNING = new ValidatePolicyFindingType("WARNING");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ValidatePolicyFindingType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ValidatePolicyFindingType FindValue(string value)
{
return FindValue<ValidatePolicyFindingType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ValidatePolicyFindingType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type ValidatePolicyResourceType.
/// </summary>
public class ValidatePolicyResourceType : ConstantClass
{
/// <summary>
/// Constant AWSIAMAssumeRolePolicyDocument for ValidatePolicyResourceType
/// </summary>
public static readonly ValidatePolicyResourceType AWSIAMAssumeRolePolicyDocument = new ValidatePolicyResourceType("AWS::IAM::AssumeRolePolicyDocument");
/// <summary>
/// Constant AWSS3AccessPoint for ValidatePolicyResourceType
/// </summary>
public static readonly ValidatePolicyResourceType AWSS3AccessPoint = new ValidatePolicyResourceType("AWS::S3::AccessPoint");
/// <summary>
/// Constant AWSS3Bucket for ValidatePolicyResourceType
/// </summary>
public static readonly ValidatePolicyResourceType AWSS3Bucket = new ValidatePolicyResourceType("AWS::S3::Bucket");
/// <summary>
/// Constant AWSS3MultiRegionAccessPoint for ValidatePolicyResourceType
/// </summary>
public static readonly ValidatePolicyResourceType AWSS3MultiRegionAccessPoint = new ValidatePolicyResourceType("AWS::S3::MultiRegionAccessPoint");
/// <summary>
/// Constant AWSS3ObjectLambdaAccessPoint for ValidatePolicyResourceType
/// </summary>
public static readonly ValidatePolicyResourceType AWSS3ObjectLambdaAccessPoint = new ValidatePolicyResourceType("AWS::S3ObjectLambda::AccessPoint");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ValidatePolicyResourceType(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ValidatePolicyResourceType FindValue(string value)
{
return FindValue<ValidatePolicyResourceType>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ValidatePolicyResourceType(string value)
{
return FindValue(value);
}
}
/// <summary>
/// Constants used for properties of type ValidationExceptionReason.
/// </summary>
public class ValidationExceptionReason : ConstantClass
{
/// <summary>
/// Constant CannotParse for ValidationExceptionReason
/// </summary>
public static readonly ValidationExceptionReason CannotParse = new ValidationExceptionReason("cannotParse");
/// <summary>
/// Constant FieldValidationFailed for ValidationExceptionReason
/// </summary>
public static readonly ValidationExceptionReason FieldValidationFailed = new ValidationExceptionReason("fieldValidationFailed");
/// <summary>
/// Constant Other for ValidationExceptionReason
/// </summary>
public static readonly ValidationExceptionReason Other = new ValidationExceptionReason("other");
/// <summary>
/// Constant UnknownOperation for ValidationExceptionReason
/// </summary>
public static readonly ValidationExceptionReason UnknownOperation = new ValidationExceptionReason("unknownOperation");
/// <summary>
/// This constant constructor does not need to be called if the constant
/// you are attempting to use is already defined as a static instance of
/// this class.
/// This constructor should be used to construct constants that are not
/// defined as statics, for instance if attempting to use a feature that is
/// newer than the current version of the SDK.
/// </summary>
public ValidationExceptionReason(string value)
: base(value)
{
}
/// <summary>
/// Finds the constant for the unique value.
/// </summary>
/// <param name="value">The unique value for the constant</param>
/// <returns>The constant for the unique value</returns>
public static ValidationExceptionReason FindValue(string value)
{
return FindValue<ValidationExceptionReason>(value);
}
/// <summary>
/// Utility method to convert strings to the constant class.
/// </summary>
/// <param name="value">The string value to convert to the constant class.</param>
/// <returns></returns>
public static implicit operator ValidationExceptionReason(string value)
{
return FindValue(value);
}
}
} | 1,246 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using Amazon.Runtime;
using Amazon.Runtime.Endpoints;
using static Amazon.Runtime.Internal.Endpoints.StandardLibrary.Fn;
namespace Amazon.AccessAnalyzer.Internal
{
/// <summary>
/// Amazon AccessAnalyzer endpoint provider.
/// Resolves endpoint for given set of AccessAnalyzerEndpointParameters.
/// Can throw AmazonClientException if endpoint resolution is unsuccessful.
/// </summary>
public class AmazonAccessAnalyzerEndpointProvider : IEndpointProvider
{
/// <summary>
/// Resolve endpoint for AccessAnalyzerEndpointParameters
/// </summary>
public Endpoint ResolveEndpoint(EndpointParameters parameters)
{
if (parameters == null)
throw new ArgumentNullException("parameters");
if (parameters["Region"] == null)
throw new AmazonClientException("Region parameter must be set for endpoint resolution");
if (parameters["UseDualStack"] == null)
throw new AmazonClientException("UseDualStack parameter must be set for endpoint resolution");
if (parameters["UseFIPS"] == null)
throw new AmazonClientException("UseFIPS parameter must be set for endpoint resolution");
var refs = new Dictionary<string, object>()
{
["Region"] = parameters["Region"],
["UseDualStack"] = parameters["UseDualStack"],
["UseFIPS"] = parameters["UseFIPS"],
["Endpoint"] = parameters["Endpoint"],
};
if ((refs["PartitionResult"] = Partition((string)refs["Region"])) != null)
{
if (IsSet(refs["Endpoint"]))
{
if (Equals(refs["UseFIPS"], true))
{
throw new AmazonClientException("Invalid Configuration: FIPS and custom endpoint are not supported");
}
if (Equals(refs["UseDualStack"], true))
{
throw new AmazonClientException("Invalid Configuration: Dualstack and custom endpoint are not supported");
}
return new Endpoint((string)refs["Endpoint"], InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
if (Equals(refs["UseFIPS"], true) && Equals(refs["UseDualStack"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsFIPS")) && Equals(true, GetAttr(refs["PartitionResult"], "supportsDualStack")))
{
return new Endpoint(Interpolate(@"https://access-analyzer-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("FIPS and DualStack are enabled, but this partition does not support one or both");
}
if (Equals(refs["UseFIPS"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsFIPS")))
{
if (Equals("aws-us-gov", GetAttr(refs["PartitionResult"], "name")))
{
return new Endpoint(Interpolate(@"https://access-analyzer.{Region}.amazonaws.com", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
return new Endpoint(Interpolate(@"https://access-analyzer-fips.{Region}.{PartitionResult#dnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("FIPS is enabled but this partition does not support FIPS");
}
if (Equals(refs["UseDualStack"], true))
{
if (Equals(true, GetAttr(refs["PartitionResult"], "supportsDualStack")))
{
return new Endpoint(Interpolate(@"https://access-analyzer.{Region}.{PartitionResult#dualStackDnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("DualStack is enabled but this partition does not support DualStack");
}
if (Equals(refs["Region"], "us-gov-east-1"))
{
return new Endpoint("https://access-analyzer.us-gov-east-1.amazonaws.com", InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
if (Equals(refs["Region"], "us-gov-west-1"))
{
return new Endpoint("https://access-analyzer.us-gov-west-1.amazonaws.com", InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
return new Endpoint(Interpolate(@"https://access-analyzer.{Region}.{PartitionResult#dnsSuffix}", refs), InterpolateJson(@"", refs), InterpolateJson(@"", refs));
}
throw new AmazonClientException("Cannot resolve endpoint");
}
}
} | 113 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using Amazon.AccessAnalyzer.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Endpoints;
using Amazon.Util;
using Amazon.AccessAnalyzer.Endpoints;
#pragma warning disable 1591
namespace Amazon.AccessAnalyzer.Internal
{
/// <summary>
/// Amazon AccessAnalyzer endpoint resolver.
/// Custom PipelineHandler responsible for resolving endpoint and setting authentication parameters for AccessAnalyzer service requests.
/// Collects values for AccessAnalyzerEndpointParameters and then tries to resolve endpoint by calling
/// ResolveEndpoint method on GlobalEndpoints.Provider if present, otherwise uses AccessAnalyzerEndpointProvider.
/// Responsible for setting authentication and http headers provided by resolved endpoint.
/// </summary>
public class AmazonAccessAnalyzerEndpointResolver : BaseEndpointResolver
{
protected override void ServiceSpecificHandler(IExecutionContext executionContext, EndpointParameters parameters)
{
InjectHostPrefix(executionContext.RequestContext);
}
protected override EndpointParameters MapEndpointsParameters(IRequestContext requestContext)
{
var config = (AmazonAccessAnalyzerConfig)requestContext.ClientConfig;
var result = new AccessAnalyzerEndpointParameters();
result.Region = config.RegionEndpoint?.SystemName;
result.UseDualStack = config.UseDualstackEndpoint;
result.UseFIPS = config.UseFIPSEndpoint;
result.Endpoint = config.ServiceURL;
// The region needs to be determined from the ServiceURL if not set.
var regionEndpoint = config.RegionEndpoint;
if (regionEndpoint == null && !string.IsNullOrEmpty(config.ServiceURL))
{
var regionName = AWSSDKUtils.DetermineRegion(config.ServiceURL);
result.Region = RegionEndpoint.GetBySystemName(regionName).SystemName;
}
// To support legacy endpoint overridding rules in the endpoints.json
if (result.Region == "us-east-1-regional")
{
result.Region = "us-east-1";
}
// Use AlternateEndpoint region override if set
if (requestContext.Request.AlternateEndpoint != null)
{
result.Region = requestContext.Request.AlternateEndpoint.SystemName;
}
// Assign staticContextParams and contextParam per operation
return result;
}
}
} | 83 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Internal
{
/// <summary>
/// Service metadata for Amazon AccessAnalyzer service
/// </summary>
public partial class AmazonAccessAnalyzerMetadata : IServiceMetadata
{
/// <summary>
/// Gets the value of the Service Id.
/// </summary>
public string ServiceId
{
get
{
return "AccessAnalyzer";
}
}
/// <summary>
/// Gets the dictionary that gives mapping of renamed operations
/// </summary>
public System.Collections.Generic.IDictionary<string, string> OperationNameMapping
{
get
{
return new System.Collections.Generic.Dictionary<string, string>(0)
{
};
}
}
}
} | 55 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// You do not have sufficient access to perform this action.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class AccessDeniedException : AmazonAccessAnalyzerException
{
/// <summary>
/// Constructs a new AccessDeniedException with the specified error
/// message.
/// </summary>
/// <param name="message">
/// Describes the error encountered.
/// </param>
public AccessDeniedException(string message)
: base(message) {}
/// <summary>
/// Construct instance of AccessDeniedException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public AccessDeniedException(string message, Exception innerException)
: base(message, innerException) {}
/// <summary>
/// Construct instance of AccessDeniedException
/// </summary>
/// <param name="innerException"></param>
public AccessDeniedException(Exception innerException)
: base(innerException) {}
/// <summary>
/// Construct instance of AccessDeniedException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AccessDeniedException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of AccessDeniedException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public AccessDeniedException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode) {}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the AccessDeniedException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected AccessDeniedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
#if BCL35
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
#endif
[System.Security.SecurityCritical]
// These FxCop rules are giving false-positives for this method
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
}
#endif
}
} | 124 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about an access preview.
/// </summary>
public partial class AccessPreview
{
private string _analyzerArn;
private Dictionary<string, Configuration> _configurations = new Dictionary<string, Configuration>();
private DateTime? _createdAt;
private string _id;
private AccessPreviewStatus _status;
private AccessPreviewStatusReason _statusReason;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The ARN of the analyzer used to generate the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property Configurations.
/// <para>
/// A map of resource ARNs for the proposed resource configuration.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, Configuration> Configurations
{
get { return this._configurations; }
set { this._configurations = value; }
}
// Check to see if Configurations property is set
internal bool IsSetConfigurations()
{
return this._configurations != null && this._configurations.Count > 0;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the access preview was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The unique ID for the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The status of the access preview.
/// </para>
/// <ul> <li>
/// <para>
/// <code>Creating</code> - The access preview creation is in progress.
/// </para>
/// </li> <li>
/// <para>
/// <code>Completed</code> - The access preview is complete. You can preview findings
/// for external access to the resource.
/// </para>
/// </li> <li>
/// <para>
/// <code>Failed</code> - The access preview creation has failed.
/// </para>
/// </li> </ul>
/// </summary>
[AWSProperty(Required=true)]
public AccessPreviewStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property StatusReason.
/// <para>
/// Provides more details about the current status of the access preview.
/// </para>
///
/// <para>
/// For example, if the creation of the access preview fails, a <code>Failed</code> status
/// is returned. This failure can be due to an internal issue with the analysis or due
/// to an invalid resource configuration.
/// </para>
/// </summary>
public AccessPreviewStatusReason StatusReason
{
get { return this._statusReason; }
set { this._statusReason = value; }
}
// Check to see if StatusReason property is set
internal bool IsSetStatusReason()
{
return this._statusReason != null;
}
}
} | 177 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// An access preview finding generated by the access preview.
/// </summary>
public partial class AccessPreviewFinding
{
private List<string> _action = new List<string>();
private FindingChangeType _changeType;
private Dictionary<string, string> _condition = new Dictionary<string, string>();
private DateTime? _createdAt;
private string _error;
private string _existingFindingId;
private FindingStatus _existingFindingStatus;
private string _id;
private bool? _isPublic;
private Dictionary<string, string> _principal = new Dictionary<string, string>();
private string _resource;
private string _resourceOwnerAccount;
private ResourceType _resourceType;
private List<FindingSource> _sources = new List<FindingSource>();
private FindingStatus _status;
/// <summary>
/// Gets and sets the property Action.
/// <para>
/// The action in the analyzed policy statement that an external principal has permission
/// to perform.
/// </para>
/// </summary>
public List<string> Action
{
get { return this._action; }
set { this._action = value; }
}
// Check to see if Action property is set
internal bool IsSetAction()
{
return this._action != null && this._action.Count > 0;
}
/// <summary>
/// Gets and sets the property ChangeType.
/// <para>
/// Provides context on how the access preview finding compares to existing access identified
/// in IAM Access Analyzer.
/// </para>
/// <ul> <li>
/// <para>
/// <code>New</code> - The finding is for newly-introduced access.
/// </para>
/// </li> <li>
/// <para>
/// <code>Unchanged</code> - The preview finding is an existing finding that would remain
/// unchanged.
/// </para>
/// </li> <li>
/// <para>
/// <code>Changed</code> - The preview finding is an existing finding with a change in
/// status.
/// </para>
/// </li> </ul>
/// <para>
/// For example, a <code>Changed</code> finding with preview status <code>Resolved</code>
/// and existing status <code>Active</code> indicates the existing <code>Active</code>
/// finding would become <code>Resolved</code> as a result of the proposed permissions
/// change.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public FindingChangeType ChangeType
{
get { return this._changeType; }
set { this._changeType = value; }
}
// Check to see if ChangeType property is set
internal bool IsSetChangeType()
{
return this._changeType != null;
}
/// <summary>
/// Gets and sets the property Condition.
/// <para>
/// The condition in the analyzed policy statement that resulted in a finding.
/// </para>
/// </summary>
public Dictionary<string, string> Condition
{
get { return this._condition; }
set { this._condition = value; }
}
// Check to see if Condition property is set
internal bool IsSetCondition()
{
return this._condition != null && this._condition.Count > 0;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the access preview finding was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Error.
/// <para>
/// An error.
/// </para>
/// </summary>
public string Error
{
get { return this._error; }
set { this._error = value; }
}
// Check to see if Error property is set
internal bool IsSetError()
{
return this._error != null;
}
/// <summary>
/// Gets and sets the property ExistingFindingId.
/// <para>
/// The existing ID of the finding in IAM Access Analyzer, provided only for existing
/// findings.
/// </para>
/// </summary>
public string ExistingFindingId
{
get { return this._existingFindingId; }
set { this._existingFindingId = value; }
}
// Check to see if ExistingFindingId property is set
internal bool IsSetExistingFindingId()
{
return this._existingFindingId != null;
}
/// <summary>
/// Gets and sets the property ExistingFindingStatus.
/// <para>
/// The existing status of the finding, provided only for existing findings.
/// </para>
/// </summary>
public FindingStatus ExistingFindingStatus
{
get { return this._existingFindingStatus; }
set { this._existingFindingStatus = value; }
}
// Check to see if ExistingFindingStatus property is set
internal bool IsSetExistingFindingStatus()
{
return this._existingFindingStatus != null;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The ID of the access preview finding. This ID uniquely identifies the element in the
/// list of access preview findings and is not related to the finding ID in Access Analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property IsPublic.
/// <para>
/// Indicates whether the policy that generated the finding allows public access to the
/// resource.
/// </para>
/// </summary>
public bool IsPublic
{
get { return this._isPublic.GetValueOrDefault(); }
set { this._isPublic = value; }
}
// Check to see if IsPublic property is set
internal bool IsSetIsPublic()
{
return this._isPublic.HasValue;
}
/// <summary>
/// Gets and sets the property Principal.
/// <para>
/// The external principal that has access to a resource within the zone of trust.
/// </para>
/// </summary>
public Dictionary<string, string> Principal
{
get { return this._principal; }
set { this._principal = value; }
}
// Check to see if Principal property is set
internal bool IsSetPrincipal()
{
return this._principal != null && this._principal.Count > 0;
}
/// <summary>
/// Gets and sets the property Resource.
/// <para>
/// The resource that an external principal has access to. This is the resource associated
/// with the access preview.
/// </para>
/// </summary>
public string Resource
{
get { return this._resource; }
set { this._resource = value; }
}
// Check to see if Resource property is set
internal bool IsSetResource()
{
return this._resource != null;
}
/// <summary>
/// Gets and sets the property ResourceOwnerAccount.
/// <para>
/// The Amazon Web Services account ID that owns the resource. For most Amazon Web Services
/// resources, the owning account is the account in which the resource was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceOwnerAccount
{
get { return this._resourceOwnerAccount; }
set { this._resourceOwnerAccount = value; }
}
// Check to see if ResourceOwnerAccount property is set
internal bool IsSetResourceOwnerAccount()
{
return this._resourceOwnerAccount != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of the resource that can be accessed in the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
/// <summary>
/// Gets and sets the property Sources.
/// <para>
/// The sources of the finding. This indicates how the access that generated the finding
/// is granted. It is populated for Amazon S3 bucket findings.
/// </para>
/// </summary>
public List<FindingSource> Sources
{
get { return this._sources; }
set { this._sources = value; }
}
// Check to see if Sources property is set
internal bool IsSetSources()
{
return this._sources != null && this._sources.Count > 0;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The preview status of the finding. This is what the status of the finding would be
/// after permissions deployment. For example, a <code>Changed</code> finding with preview
/// status <code>Resolved</code> and existing status <code>Active</code> indicates the
/// existing <code>Active</code> finding would become <code>Resolved</code> as a result
/// of the proposed permissions change.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public FindingStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
}
} | 362 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Provides more details about the current status of the access preview. For example,
/// if the creation of the access preview fails, a <code>Failed</code> status is returned.
/// This failure can be due to an internal issue with the analysis or due to an invalid
/// proposed resource configuration.
/// </summary>
public partial class AccessPreviewStatusReason
{
private AccessPreviewStatusReasonCode _code;
/// <summary>
/// Gets and sets the property Code.
/// <para>
/// The reason code for the current status of the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public AccessPreviewStatusReasonCode Code
{
get { return this._code; }
set { this._code = value; }
}
// Check to see if Code property is set
internal bool IsSetCode()
{
return this._code != null;
}
}
} | 61 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains a summary of information about an access preview.
/// </summary>
public partial class AccessPreviewSummary
{
private string _analyzerArn;
private DateTime? _createdAt;
private string _id;
private AccessPreviewStatus _status;
private AccessPreviewStatusReason _statusReason;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The ARN of the analyzer used to generate the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the access preview was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The unique ID for the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The status of the access preview.
/// </para>
/// <ul> <li>
/// <para>
/// <code>Creating</code> - The access preview creation is in progress.
/// </para>
/// </li> <li>
/// <para>
/// <code>Completed</code> - The access preview is complete and previews the findings
/// for external access to the resource.
/// </para>
/// </li> <li>
/// <para>
/// <code>Failed</code> - The access preview creation has failed.
/// </para>
/// </li> </ul>
/// </summary>
[AWSProperty(Required=true)]
public AccessPreviewStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property StatusReason.
/// </summary>
public AccessPreviewStatusReason StatusReason
{
get { return this._statusReason; }
set { this._statusReason = value; }
}
// Check to see if StatusReason property is set
internal bool IsSetStatusReason()
{
return this._statusReason != null;
}
}
} | 148 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// You specify each grantee as a type-value pair using one of these types. You can specify
/// only one type of grantee. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAcl.html">PutBucketAcl</a>.
/// </summary>
public partial class AclGrantee
{
private string _id;
private string _uri;
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The value specified is the canonical user ID of an Amazon Web Services account.
/// </para>
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property Uri.
/// <para>
/// Used for granting permissions to a predefined group.
/// </para>
/// </summary>
public string Uri
{
get { return this._uri; }
set { this._uri = value; }
}
// Check to see if Uri property is set
internal bool IsSetUri()
{
return this._uri != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using Amazon.Runtime;
namespace Amazon.AccessAnalyzer
{
/// <summary>
/// Base class for AccessAnalyzer operation requests.
/// </summary>
public partial class AmazonAccessAnalyzerRequest : AmazonWebServiceRequest
{
}
} | 30 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains details about the analyzed resource.
/// </summary>
public partial class AnalyzedResource
{
private List<string> _actions = new List<string>();
private DateTime? _analyzedAt;
private DateTime? _createdAt;
private string _error;
private bool? _isPublic;
private string _resourceArn;
private string _resourceOwnerAccount;
private ResourceType _resourceType;
private List<string> _sharedVia = new List<string>();
private FindingStatus _status;
private DateTime? _updatedAt;
/// <summary>
/// Gets and sets the property Actions.
/// <para>
/// The actions that an external principal is granted permission to use by the policy
/// that generated the finding.
/// </para>
/// </summary>
public List<string> Actions
{
get { return this._actions; }
set { this._actions = value; }
}
// Check to see if Actions property is set
internal bool IsSetActions()
{
return this._actions != null && this._actions.Count > 0;
}
/// <summary>
/// Gets and sets the property AnalyzedAt.
/// <para>
/// The time at which the resource was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime AnalyzedAt
{
get { return this._analyzedAt.GetValueOrDefault(); }
set { this._analyzedAt = value; }
}
// Check to see if AnalyzedAt property is set
internal bool IsSetAnalyzedAt()
{
return this._analyzedAt.HasValue;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the finding was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Error.
/// <para>
/// An error message.
/// </para>
/// </summary>
public string Error
{
get { return this._error; }
set { this._error = value; }
}
// Check to see if Error property is set
internal bool IsSetError()
{
return this._error != null;
}
/// <summary>
/// Gets and sets the property IsPublic.
/// <para>
/// Indicates whether the policy that generated the finding grants public access to the
/// resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public bool IsPublic
{
get { return this._isPublic.GetValueOrDefault(); }
set { this._isPublic = value; }
}
// Check to see if IsPublic property is set
internal bool IsSetIsPublic()
{
return this._isPublic.HasValue;
}
/// <summary>
/// Gets and sets the property ResourceArn.
/// <para>
/// The ARN of the resource that was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceArn
{
get { return this._resourceArn; }
set { this._resourceArn = value; }
}
// Check to see if ResourceArn property is set
internal bool IsSetResourceArn()
{
return this._resourceArn != null;
}
/// <summary>
/// Gets and sets the property ResourceOwnerAccount.
/// <para>
/// The Amazon Web Services account ID that owns the resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceOwnerAccount
{
get { return this._resourceOwnerAccount; }
set { this._resourceOwnerAccount = value; }
}
// Check to see if ResourceOwnerAccount property is set
internal bool IsSetResourceOwnerAccount()
{
return this._resourceOwnerAccount != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of the resource that was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
/// <summary>
/// Gets and sets the property SharedVia.
/// <para>
/// Indicates how the access that generated the finding is granted. This is populated
/// for Amazon S3 bucket findings.
/// </para>
/// </summary>
public List<string> SharedVia
{
get { return this._sharedVia; }
set { this._sharedVia = value; }
}
// Check to see if SharedVia property is set
internal bool IsSetSharedVia()
{
return this._sharedVia != null && this._sharedVia.Count > 0;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The current status of the finding generated from the analyzed resource.
/// </para>
/// </summary>
public FindingStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property UpdatedAt.
/// <para>
/// The time at which the finding was updated.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime UpdatedAt
{
get { return this._updatedAt.GetValueOrDefault(); }
set { this._updatedAt = value; }
}
// Check to see if UpdatedAt property is set
internal bool IsSetUpdatedAt()
{
return this._updatedAt.HasValue;
}
}
} | 257 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains the ARN of the analyzed resource.
/// </summary>
public partial class AnalyzedResourceSummary
{
private string _resourceArn;
private string _resourceOwnerAccount;
private ResourceType _resourceType;
/// <summary>
/// Gets and sets the property ResourceArn.
/// <para>
/// The ARN of the analyzed resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceArn
{
get { return this._resourceArn; }
set { this._resourceArn = value; }
}
// Check to see if ResourceArn property is set
internal bool IsSetResourceArn()
{
return this._resourceArn != null;
}
/// <summary>
/// Gets and sets the property ResourceOwnerAccount.
/// <para>
/// The Amazon Web Services account ID that owns the resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceOwnerAccount
{
get { return this._resourceOwnerAccount; }
set { this._resourceOwnerAccount = value; }
}
// Check to see if ResourceOwnerAccount property is set
internal bool IsSetResourceOwnerAccount()
{
return this._resourceOwnerAccount != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of resource that was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
}
} | 98 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about the analyzer.
/// </summary>
public partial class AnalyzerSummary
{
private string _arn;
private DateTime? _createdAt;
private string _lastResourceAnalyzed;
private DateTime? _lastResourceAnalyzedAt;
private string _name;
private AnalyzerStatus _status;
private StatusReason _statusReason;
private Dictionary<string, string> _tags = new Dictionary<string, string>();
private Type _type;
/// <summary>
/// Gets and sets the property Arn.
/// <para>
/// The ARN of the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Arn
{
get { return this._arn; }
set { this._arn = value; }
}
// Check to see if Arn property is set
internal bool IsSetArn()
{
return this._arn != null;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// A timestamp for the time at which the analyzer was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property LastResourceAnalyzed.
/// <para>
/// The resource that was most recently analyzed by the analyzer.
/// </para>
/// </summary>
public string LastResourceAnalyzed
{
get { return this._lastResourceAnalyzed; }
set { this._lastResourceAnalyzed = value; }
}
// Check to see if LastResourceAnalyzed property is set
internal bool IsSetLastResourceAnalyzed()
{
return this._lastResourceAnalyzed != null;
}
/// <summary>
/// Gets and sets the property LastResourceAnalyzedAt.
/// <para>
/// The time at which the most recently analyzed resource was analyzed.
/// </para>
/// </summary>
public DateTime LastResourceAnalyzedAt
{
get { return this._lastResourceAnalyzedAt.GetValueOrDefault(); }
set { this._lastResourceAnalyzedAt = value; }
}
// Check to see if LastResourceAnalyzedAt property is set
internal bool IsSetLastResourceAnalyzedAt()
{
return this._lastResourceAnalyzedAt.HasValue;
}
/// <summary>
/// Gets and sets the property Name.
/// <para>
/// The name of the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string Name
{
get { return this._name; }
set { this._name = value; }
}
// Check to see if Name property is set
internal bool IsSetName()
{
return this._name != null;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The status of the analyzer. An <code>Active</code> analyzer successfully monitors
/// supported resources and generates new findings. The analyzer is <code>Disabled</code>
/// when a user action, such as removing trusted access for Identity and Access Management
/// Access Analyzer from Organizations, causes the analyzer to stop generating new findings.
/// The status is <code>Creating</code> when the analyzer creation is in progress and
/// <code>Failed</code> when the analyzer creation has failed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public AnalyzerStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property StatusReason.
/// <para>
/// The <code>statusReason</code> provides more details about the current status of the
/// analyzer. For example, if the creation for the analyzer fails, a <code>Failed</code>
/// status is returned. For an analyzer with organization as the type, this failure can
/// be due to an issue with creating the service-linked roles required in the member accounts
/// of the Amazon Web Services organization.
/// </para>
/// </summary>
public StatusReason StatusReason
{
get { return this._statusReason; }
set { this._statusReason = value; }
}
// Check to see if StatusReason property is set
internal bool IsSetStatusReason()
{
return this._statusReason != null;
}
/// <summary>
/// Gets and sets the property Tags.
/// <para>
/// The tags added to the analyzer.
/// </para>
/// </summary>
public Dictionary<string, string> Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
/// <summary>
/// Gets and sets the property Type.
/// <para>
/// The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Type Type
{
get { return this._type; }
set { this._type = value; }
}
// Check to see if Type property is set
internal bool IsSetType()
{
return this._type != null;
}
}
} | 223 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ApplyArchiveRule operation.
/// Retroactively applies the archive rule to existing findings that meet the archive
/// rule criteria.
/// </summary>
public partial class ApplyArchiveRuleRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private string _clientToken;
private string _ruleName;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The Amazon resource name (ARN) of the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the rule to apply.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
}
} | 99 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the ApplyArchiveRule operation.
/// </summary>
public partial class ApplyArchiveRuleResponse : AmazonWebServiceResponse
{
}
} | 38 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about an archive rule.
/// </summary>
public partial class ArchiveRuleSummary
{
private DateTime? _createdAt;
private Dictionary<string, Criterion> _filter = new Dictionary<string, Criterion>();
private string _ruleName;
private DateTime? _updatedAt;
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the archive rule was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Filter.
/// <para>
/// A filter used to define the archive rule.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, Criterion> Filter
{
get { return this._filter; }
set { this._filter = value; }
}
// Check to see if Filter property is set
internal bool IsSetFilter()
{
return this._filter != null && this._filter.Count > 0;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the archive rule.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
/// <summary>
/// Gets and sets the property UpdatedAt.
/// <para>
/// The time at which the archive rule was last updated.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime UpdatedAt
{
get { return this._updatedAt.GetValueOrDefault(); }
set { this._updatedAt = value; }
}
// Check to see if UpdatedAt property is set
internal bool IsSetUpdatedAt()
{
return this._updatedAt.HasValue;
}
}
} | 118 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the CancelPolicyGeneration operation.
/// Cancels the requested policy generation.
/// </summary>
public partial class CancelPolicyGenerationRequest : AmazonAccessAnalyzerRequest
{
private string _jobId;
/// <summary>
/// Gets and sets the property JobId.
/// <para>
/// The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code>
/// operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code>
/// to retrieve the generated policies or used with <code>CancelPolicyGeneration</code>
/// to cancel the policy generation request.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string JobId
{
get { return this._jobId; }
set { this._jobId = value; }
}
// Check to see if JobId property is set
internal bool IsSetJobId()
{
return this._jobId != null;
}
}
} | 62 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the CancelPolicyGeneration operation.
/// </summary>
public partial class CancelPolicyGenerationResponse : AmazonWebServiceResponse
{
}
} | 38 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about CloudTrail access.
/// </summary>
public partial class CloudTrailDetails
{
private string _accessRole;
private DateTime? _endTime;
private DateTime? _startTime;
private List<Trail> _trails = new List<Trail>();
/// <summary>
/// Gets and sets the property AccessRole.
/// <para>
/// The ARN of the service role that IAM Access Analyzer uses to access your CloudTrail
/// trail and service last accessed information.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AccessRole
{
get { return this._accessRole; }
set { this._accessRole = value; }
}
// Check to see if AccessRole property is set
internal bool IsSetAccessRole()
{
return this._accessRole != null;
}
/// <summary>
/// Gets and sets the property EndTime.
/// <para>
/// The end of the time range for which IAM Access Analyzer reviews your CloudTrail events.
/// Events with a timestamp after this time are not considered to generate a policy. If
/// this is not included in the request, the default value is the current time.
/// </para>
/// </summary>
public DateTime EndTime
{
get { return this._endTime.GetValueOrDefault(); }
set { this._endTime = value; }
}
// Check to see if EndTime property is set
internal bool IsSetEndTime()
{
return this._endTime.HasValue;
}
/// <summary>
/// Gets and sets the property StartTime.
/// <para>
/// The start of the time range for which IAM Access Analyzer reviews your CloudTrail
/// events. Events with a timestamp before this time are not considered to generate a
/// policy.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime StartTime
{
get { return this._startTime.GetValueOrDefault(); }
set { this._startTime = value; }
}
// Check to see if StartTime property is set
internal bool IsSetStartTime()
{
return this._startTime.HasValue;
}
/// <summary>
/// Gets and sets the property Trails.
/// <para>
/// A <code>Trail</code> object that contains settings for a trail.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<Trail> Trails
{
get { return this._trails; }
set { this._trails = value; }
}
// Check to see if Trails property is set
internal bool IsSetTrails()
{
return this._trails != null && this._trails.Count > 0;
}
}
} | 122 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about CloudTrail access.
/// </summary>
public partial class CloudTrailProperties
{
private DateTime? _endTime;
private DateTime? _startTime;
private List<TrailProperties> _trailProperties = new List<TrailProperties>();
/// <summary>
/// Gets and sets the property EndTime.
/// <para>
/// The end of the time range for which IAM Access Analyzer reviews your CloudTrail events.
/// Events with a timestamp after this time are not considered to generate a policy. If
/// this is not included in the request, the default value is the current time.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime EndTime
{
get { return this._endTime.GetValueOrDefault(); }
set { this._endTime = value; }
}
// Check to see if EndTime property is set
internal bool IsSetEndTime()
{
return this._endTime.HasValue;
}
/// <summary>
/// Gets and sets the property StartTime.
/// <para>
/// The start of the time range for which IAM Access Analyzer reviews your CloudTrail
/// events. Events with a timestamp before this time are not considered to generate a
/// policy.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime StartTime
{
get { return this._startTime.GetValueOrDefault(); }
set { this._startTime = value; }
}
// Check to see if StartTime property is set
internal bool IsSetStartTime()
{
return this._startTime.HasValue;
}
/// <summary>
/// Gets and sets the property TrailProperties.
/// <para>
/// A <code>TrailProperties</code> object that contains settings for trail properties.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<TrailProperties> TrailProperties
{
get { return this._trailProperties; }
set { this._trailProperties = value; }
}
// Check to see if TrailProperties property is set
internal bool IsSetTrailProperties()
{
return this._trailProperties != null && this._trailProperties.Count > 0;
}
}
} | 102 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Access control configuration structures for your resource. You specify the configuration
/// as a type-value pair. You can specify only one type of access control configuration.
/// </summary>
public partial class Configuration
{
private EbsSnapshotConfiguration _ebsSnapshot;
private EcrRepositoryConfiguration _ecrRepository;
private EfsFileSystemConfiguration _efsFileSystem;
private IamRoleConfiguration _iamRole;
private KmsKeyConfiguration _kmsKey;
private RdsDbClusterSnapshotConfiguration _rdsDbClusterSnapshot;
private RdsDbSnapshotConfiguration _rdsDbSnapshot;
private S3BucketConfiguration _s3Bucket;
private SecretsManagerSecretConfiguration _secretsManagerSecret;
private SnsTopicConfiguration _snsTopic;
private SqsQueueConfiguration _sqsQueue;
/// <summary>
/// Gets and sets the property EbsSnapshot.
/// <para>
/// The access control configuration is for an Amazon EBS volume snapshot.
/// </para>
/// </summary>
public EbsSnapshotConfiguration EbsSnapshot
{
get { return this._ebsSnapshot; }
set { this._ebsSnapshot = value; }
}
// Check to see if EbsSnapshot property is set
internal bool IsSetEbsSnapshot()
{
return this._ebsSnapshot != null;
}
/// <summary>
/// Gets and sets the property EcrRepository.
/// <para>
/// The access control configuration is for an Amazon ECR repository.
/// </para>
/// </summary>
public EcrRepositoryConfiguration EcrRepository
{
get { return this._ecrRepository; }
set { this._ecrRepository = value; }
}
// Check to see if EcrRepository property is set
internal bool IsSetEcrRepository()
{
return this._ecrRepository != null;
}
/// <summary>
/// Gets and sets the property EfsFileSystem.
/// <para>
/// The access control configuration is for an Amazon EFS file system.
/// </para>
/// </summary>
public EfsFileSystemConfiguration EfsFileSystem
{
get { return this._efsFileSystem; }
set { this._efsFileSystem = value; }
}
// Check to see if EfsFileSystem property is set
internal bool IsSetEfsFileSystem()
{
return this._efsFileSystem != null;
}
/// <summary>
/// Gets and sets the property IamRole.
/// <para>
/// The access control configuration is for an IAM role.
/// </para>
/// </summary>
public IamRoleConfiguration IamRole
{
get { return this._iamRole; }
set { this._iamRole = value; }
}
// Check to see if IamRole property is set
internal bool IsSetIamRole()
{
return this._iamRole != null;
}
/// <summary>
/// Gets and sets the property KmsKey.
/// <para>
/// The access control configuration is for a KMS key.
/// </para>
/// </summary>
public KmsKeyConfiguration KmsKey
{
get { return this._kmsKey; }
set { this._kmsKey = value; }
}
// Check to see if KmsKey property is set
internal bool IsSetKmsKey()
{
return this._kmsKey != null;
}
/// <summary>
/// Gets and sets the property RdsDbClusterSnapshot.
/// <para>
/// The access control configuration is for an Amazon RDS DB cluster snapshot.
/// </para>
/// </summary>
public RdsDbClusterSnapshotConfiguration RdsDbClusterSnapshot
{
get { return this._rdsDbClusterSnapshot; }
set { this._rdsDbClusterSnapshot = value; }
}
// Check to see if RdsDbClusterSnapshot property is set
internal bool IsSetRdsDbClusterSnapshot()
{
return this._rdsDbClusterSnapshot != null;
}
/// <summary>
/// Gets and sets the property RdsDbSnapshot.
/// <para>
/// The access control configuration is for an Amazon RDS DB snapshot.
/// </para>
/// </summary>
public RdsDbSnapshotConfiguration RdsDbSnapshot
{
get { return this._rdsDbSnapshot; }
set { this._rdsDbSnapshot = value; }
}
// Check to see if RdsDbSnapshot property is set
internal bool IsSetRdsDbSnapshot()
{
return this._rdsDbSnapshot != null;
}
/// <summary>
/// Gets and sets the property S3Bucket.
/// <para>
/// The access control configuration is for an Amazon S3 Bucket.
/// </para>
/// </summary>
public S3BucketConfiguration S3Bucket
{
get { return this._s3Bucket; }
set { this._s3Bucket = value; }
}
// Check to see if S3Bucket property is set
internal bool IsSetS3Bucket()
{
return this._s3Bucket != null;
}
/// <summary>
/// Gets and sets the property SecretsManagerSecret.
/// <para>
/// The access control configuration is for a Secrets Manager secret.
/// </para>
/// </summary>
public SecretsManagerSecretConfiguration SecretsManagerSecret
{
get { return this._secretsManagerSecret; }
set { this._secretsManagerSecret = value; }
}
// Check to see if SecretsManagerSecret property is set
internal bool IsSetSecretsManagerSecret()
{
return this._secretsManagerSecret != null;
}
/// <summary>
/// Gets and sets the property SnsTopic.
/// <para>
/// The access control configuration is for an Amazon SNS topic
/// </para>
/// </summary>
public SnsTopicConfiguration SnsTopic
{
get { return this._snsTopic; }
set { this._snsTopic = value; }
}
// Check to see if SnsTopic property is set
internal bool IsSetSnsTopic()
{
return this._snsTopic != null;
}
/// <summary>
/// Gets and sets the property SqsQueue.
/// <para>
/// The access control configuration is for an Amazon SQS queue.
/// </para>
/// </summary>
public SqsQueueConfiguration SqsQueue
{
get { return this._sqsQueue; }
set { this._sqsQueue = value; }
}
// Check to see if SqsQueue property is set
internal bool IsSetSqsQueue()
{
return this._sqsQueue != null;
}
}
} | 248 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// A conflict exception error.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class ConflictException : AmazonAccessAnalyzerException
{
private string _resourceId;
private string _resourceType;
/// <summary>
/// Constructs a new ConflictException with the specified error
/// message.
/// </summary>
/// <param name="message">
/// Describes the error encountered.
/// </param>
public ConflictException(string message)
: base(message) {}
/// <summary>
/// Construct instance of ConflictException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public ConflictException(string message, Exception innerException)
: base(message, innerException) {}
/// <summary>
/// Construct instance of ConflictException
/// </summary>
/// <param name="innerException"></param>
public ConflictException(Exception innerException)
: base(innerException) {}
/// <summary>
/// Construct instance of ConflictException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public ConflictException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of ConflictException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public ConflictException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode) {}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the ConflictException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected ConflictException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
this.ResourceId = (string)info.GetValue("ResourceId", typeof(string));
this.ResourceType = (string)info.GetValue("ResourceType", typeof(string));
}
/// <summary>
/// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
#if BCL35
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
#endif
[System.Security.SecurityCritical]
// These FxCop rules are giving false-positives for this method
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("ResourceId", this.ResourceId);
info.AddValue("ResourceType", this.ResourceType);
}
#endif
/// <summary>
/// Gets and sets the property ResourceId.
/// <para>
/// The ID of the resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceId
{
get { return this._resourceId; }
set { this._resourceId = value; }
}
// Check to see if ResourceId property is set
internal bool IsSetResourceId()
{
return this._resourceId != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The resource type.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
}
} | 168 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the CreateAccessPreview operation.
/// Creates an access preview that allows you to preview IAM Access Analyzer findings
/// for your resource before deploying resource permissions.
/// </summary>
public partial class CreateAccessPreviewRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private string _clientToken;
private Dictionary<string, Configuration> _configurations = new Dictionary<string, Configuration>();
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the account analyzer</a> used to generate the access preview. You can only create
/// an access preview for analyzers with an <code>Account</code> type and <code>Active</code>
/// status.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
/// <summary>
/// Gets and sets the property Configurations.
/// <para>
/// Access control configuration for your resource that is used to generate the access
/// preview. The access preview includes findings for external access allowed to the resource
/// with the proposed access control configuration. The configuration must contain exactly
/// one element.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, Configuration> Configurations
{
get { return this._configurations; }
set { this._configurations = value; }
}
// Check to see if Configurations property is set
internal bool IsSetConfigurations()
{
return this._configurations != null && this._configurations.Count > 0;
}
}
} | 105 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the CreateAccessPreview operation.
/// </summary>
public partial class CreateAccessPreviewResponse : AmazonWebServiceResponse
{
private string _id;
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The unique ID for the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
}
} | 58 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the CreateAnalyzer operation.
/// Creates an analyzer for your account.
/// </summary>
public partial class CreateAnalyzerRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private List<InlineArchiveRule> _archiveRules = new List<InlineArchiveRule>();
private string _clientToken;
private Dictionary<string, string> _tags = new Dictionary<string, string>();
private Type _type;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer to create.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property ArchiveRules.
/// <para>
/// Specifies the archive rules to add for the analyzer. Archive rules automatically archive
/// findings that meet the criteria you define for the rule.
/// </para>
/// </summary>
public List<InlineArchiveRule> ArchiveRules
{
get { return this._archiveRules; }
set { this._archiveRules = value; }
}
// Check to see if ArchiveRules property is set
internal bool IsSetArchiveRules()
{
return this._archiveRules != null && this._archiveRules.Count > 0;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
/// <summary>
/// Gets and sets the property Tags.
/// <para>
/// The tags to apply to the analyzer.
/// </para>
/// </summary>
public Dictionary<string, string> Tags
{
get { return this._tags; }
set { this._tags = value; }
}
// Check to see if Tags property is set
internal bool IsSetTags()
{
return this._tags != null && this._tags.Count > 0;
}
/// <summary>
/// Gets and sets the property Type.
/// <para>
/// The type of analyzer to create. Only ACCOUNT and ORGANIZATION analyzers are supported.
/// You can create only one analyzer per account per Region. You can create up to 5 analyzers
/// per organization per Region.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Type Type
{
get { return this._type; }
set { this._type = value; }
}
// Check to see if Type property is set
internal bool IsSetType()
{
return this._type != null;
}
}
} | 139 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request to create an analyzer.
/// </summary>
public partial class CreateAnalyzerResponse : AmazonWebServiceResponse
{
private string _arn;
/// <summary>
/// Gets and sets the property Arn.
/// <para>
/// The ARN of the analyzer that was created by the request.
/// </para>
/// </summary>
public string Arn
{
get { return this._arn; }
set { this._arn = value; }
}
// Check to see if Arn property is set
internal bool IsSetArn()
{
return this._arn != null;
}
}
} | 57 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the CreateArchiveRule operation.
/// Creates an archive rule for the specified analyzer. Archive rules automatically archive
/// new findings that meet the criteria you define when you create the rule.
///
///
/// <para>
/// To learn about filter keys that you can use to create an archive rule, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM
/// Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.
/// </para>
/// </summary>
public partial class CreateArchiveRuleRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private string _clientToken;
private Dictionary<string, Criterion> _filter = new Dictionary<string, Criterion>();
private string _ruleName;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the created analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
/// <summary>
/// Gets and sets the property Filter.
/// <para>
/// The criteria for the rule.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, Criterion> Filter
{
get { return this._filter; }
set { this._filter = value; }
}
// Check to see if Filter property is set
internal bool IsSetFilter()
{
return this._filter != null && this._filter.Count > 0;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the rule to create.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
}
} | 125 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the CreateArchiveRule operation.
/// </summary>
public partial class CreateArchiveRuleResponse : AmazonWebServiceResponse
{
}
} | 38 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The criteria to use in the filter that defines the archive rule. For more information
/// on available filter keys, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM
/// Access Analyzer filter keys</a>.
/// </summary>
public partial class Criterion
{
private List<string> _contains = new List<string>();
private List<string> _eq = new List<string>();
private bool? _exists;
private List<string> _neq = new List<string>();
/// <summary>
/// Gets and sets the property Contains.
/// <para>
/// A "contains" operator to match for the filter used to create the rule.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=20)]
public List<string> Contains
{
get { return this._contains; }
set { this._contains = value; }
}
// Check to see if Contains property is set
internal bool IsSetContains()
{
return this._contains != null && this._contains.Count > 0;
}
/// <summary>
/// Gets and sets the property Eq.
/// <para>
/// An "equals" operator to match for the filter used to create the rule.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=20)]
public List<string> Eq
{
get { return this._eq; }
set { this._eq = value; }
}
// Check to see if Eq property is set
internal bool IsSetEq()
{
return this._eq != null && this._eq.Count > 0;
}
/// <summary>
/// Gets and sets the property Exists.
/// <para>
/// An "exists" operator to match for the filter used to create the rule.
/// </para>
/// </summary>
public bool Exists
{
get { return this._exists.GetValueOrDefault(); }
set { this._exists = value; }
}
// Check to see if Exists property is set
internal bool IsSetExists()
{
return this._exists.HasValue;
}
/// <summary>
/// Gets and sets the property Neq.
/// <para>
/// A "not equals" operator to match for the filter used to create the rule.
/// </para>
/// </summary>
[AWSProperty(Min=1, Max=20)]
public List<string> Neq
{
get { return this._neq; }
set { this._neq = value; }
}
// Check to see if Neq property is set
internal bool IsSetNeq()
{
return this._neq != null && this._neq.Count > 0;
}
}
} | 119 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the DeleteAnalyzer operation.
/// Deletes the specified analyzer. When you delete an analyzer, IAM Access Analyzer is
/// disabled for the account or organization in the current or specific Region. All findings
/// that were generated by the analyzer are deleted. You cannot undo this action.
/// </summary>
public partial class DeleteAnalyzerRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private string _clientToken;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer to delete.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the DeleteAnalyzer operation.
/// </summary>
public partial class DeleteAnalyzerResponse : AmazonWebServiceResponse
{
}
} | 38 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the DeleteArchiveRule operation.
/// Deletes the specified archive rule.
/// </summary>
public partial class DeleteArchiveRuleRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private string _clientToken;
private string _ruleName;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer that associated with the archive rule to delete.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property ClientToken.
/// <para>
/// A client token.
/// </para>
/// </summary>
public string ClientToken
{
get { return this._clientToken; }
set { this._clientToken = value; }
}
// Check to see if ClientToken property is set
internal bool IsSetClientToken()
{
return this._clientToken != null;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the rule to delete.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
}
} | 98 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the DeleteArchiveRule operation.
/// </summary>
public partial class DeleteArchiveRuleResponse : AmazonWebServiceResponse
{
}
} | 38 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The proposed access control configuration for an Amazon EBS volume snapshot. You can
/// propose a configuration for a new Amazon EBS volume snapshot or an Amazon EBS volume
/// snapshot that you own by specifying the user IDs, groups, and optional KMS encryption
/// key. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySnapshotAttribute.html">ModifySnapshotAttribute</a>.
/// </summary>
public partial class EbsSnapshotConfiguration
{
private List<string> _groups = new List<string>();
private string _kmsKeyId;
private List<string> _userIds = new List<string>();
/// <summary>
/// Gets and sets the property Groups.
/// <para>
/// The groups that have access to the Amazon EBS volume snapshot. If the value <code>all</code>
/// is specified, then the Amazon EBS volume snapshot is public.
/// </para>
/// <ul> <li>
/// <para>
/// If the configuration is for an existing Amazon EBS volume snapshot and you do not
/// specify the <code>groups</code>, then the access preview uses the existing shared
/// <code>groups</code> for the snapshot.
/// </para>
/// </li> <li>
/// <para>
/// If the access preview is for a new resource and you do not specify the <code>groups</code>,
/// then the access preview considers the snapshot without any <code>groups</code>.
/// </para>
/// </li> <li>
/// <para>
/// To propose deletion of existing shared <code>groups</code>, you can specify an empty
/// list for <code>groups</code>.
/// </para>
/// </li> </ul>
/// </summary>
public List<string> Groups
{
get { return this._groups; }
set { this._groups = value; }
}
// Check to see if Groups property is set
internal bool IsSetGroups()
{
return this._groups != null && this._groups.Count > 0;
}
/// <summary>
/// Gets and sets the property KmsKeyId.
/// <para>
/// The KMS key identifier for an encrypted Amazon EBS volume snapshot. The KMS key identifier
/// is the key ARN, key ID, alias ARN, or alias name for the KMS key.
/// </para>
/// <ul> <li>
/// <para>
/// If the configuration is for an existing Amazon EBS volume snapshot and you do not
/// specify the <code>kmsKeyId</code>, or you specify an empty string, then the access
/// preview uses the existing <code>kmsKeyId</code> of the snapshot.
/// </para>
/// </li> <li>
/// <para>
/// If the access preview is for a new resource and you do not specify the <code>kmsKeyId</code>,
/// the access preview considers the snapshot as unencrypted.
/// </para>
/// </li> </ul>
/// </summary>
public string KmsKeyId
{
get { return this._kmsKeyId; }
set { this._kmsKeyId = value; }
}
// Check to see if KmsKeyId property is set
internal bool IsSetKmsKeyId()
{
return this._kmsKeyId != null;
}
/// <summary>
/// Gets and sets the property UserIds.
/// <para>
/// The IDs of the Amazon Web Services accounts that have access to the Amazon EBS volume
/// snapshot.
/// </para>
/// <ul> <li>
/// <para>
/// If the configuration is for an existing Amazon EBS volume snapshot and you do not
/// specify the <code>userIds</code>, then the access preview uses the existing shared
/// <code>userIds</code> for the snapshot.
/// </para>
/// </li> <li>
/// <para>
/// If the access preview is for a new resource and you do not specify the <code>userIds</code>,
/// then the access preview considers the snapshot without any <code>userIds</code>.
/// </para>
/// </li> <li>
/// <para>
/// To propose deletion of existing shared <code>accountIds</code>, you can specify an
/// empty list for <code>userIds</code>.
/// </para>
/// </li> </ul>
/// </summary>
public List<string> UserIds
{
get { return this._userIds; }
set { this._userIds = value; }
}
// Check to see if UserIds property is set
internal bool IsSetUserIds()
{
return this._userIds != null && this._userIds.Count > 0;
}
}
} | 147 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The proposed access control configuration for an Amazon ECR repository. You can propose
/// a configuration for a new Amazon ECR repository or an existing Amazon ECR repository
/// that you own by specifying the Amazon ECR policy. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_Repository.html">Repository</a>.
///
/// <ul> <li>
/// <para>
/// If the configuration is for an existing Amazon ECR repository and you do not specify
/// the Amazon ECR policy, then the access preview uses the existing Amazon ECR policy
/// for the repository.
/// </para>
/// </li> <li>
/// <para>
/// If the access preview is for a new resource and you do not specify the policy, then
/// the access preview assumes an Amazon ECR repository without a policy.
/// </para>
/// </li> <li>
/// <para>
/// To propose deletion of an existing Amazon ECR repository policy, you can specify an
/// empty string for the Amazon ECR policy.
/// </para>
/// </li> </ul>
/// </summary>
public partial class EcrRepositoryConfiguration
{
private string _repositoryPolicy;
/// <summary>
/// Gets and sets the property RepositoryPolicy.
/// <para>
/// The JSON repository policy text to apply to the Amazon ECR repository. For more information,
/// see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/repository-policy-examples.html">Private
/// repository policy examples</a> in the <i>Amazon ECR User Guide</i>.
/// </para>
/// </summary>
public string RepositoryPolicy
{
get { return this._repositoryPolicy; }
set { this._repositoryPolicy = value; }
}
// Check to see if RepositoryPolicy property is set
internal bool IsSetRepositoryPolicy()
{
return this._repositoryPolicy != null;
}
}
} | 79 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The proposed access control configuration for an Amazon EFS file system. You can propose
/// a configuration for a new Amazon EFS file system or an existing Amazon EFS file system
/// that you own by specifying the Amazon EFS policy. For more information, see <a href="https://docs.aws.amazon.com/efs/latest/ug/using-fs.html">Using
/// file systems in Amazon EFS</a>.
///
/// <ul> <li>
/// <para>
/// If the configuration is for an existing Amazon EFS file system and you do not specify
/// the Amazon EFS policy, then the access preview uses the existing Amazon EFS policy
/// for the file system.
/// </para>
/// </li> <li>
/// <para>
/// If the access preview is for a new resource and you do not specify the policy, then
/// the access preview assumes an Amazon EFS file system without a policy.
/// </para>
/// </li> <li>
/// <para>
/// To propose deletion of an existing Amazon EFS file system policy, you can specify
/// an empty string for the Amazon EFS policy.
/// </para>
/// </li> </ul>
/// </summary>
public partial class EfsFileSystemConfiguration
{
private string _fileSystemPolicy;
/// <summary>
/// Gets and sets the property FileSystemPolicy.
/// <para>
/// The JSON policy definition to apply to the Amazon EFS file system. For more information
/// on the elements that make up a file system policy, see <a href="https://docs.aws.amazon.com/efs/latest/ug/access-control-overview.html#access-control-manage-access-intro-resource-policies">Amazon
/// EFS Resource-based policies</a>.
/// </para>
/// </summary>
public string FileSystemPolicy
{
get { return this._fileSystemPolicy; }
set { this._fileSystemPolicy = value; }
}
// Check to see if FileSystemPolicy property is set
internal bool IsSetFileSystemPolicy()
{
return this._fileSystemPolicy != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about a finding.
/// </summary>
public partial class Finding
{
private List<string> _action = new List<string>();
private DateTime? _analyzedAt;
private Dictionary<string, string> _condition = new Dictionary<string, string>();
private DateTime? _createdAt;
private string _error;
private string _id;
private bool? _isPublic;
private Dictionary<string, string> _principal = new Dictionary<string, string>();
private string _resource;
private string _resourceOwnerAccount;
private ResourceType _resourceType;
private List<FindingSource> _sources = new List<FindingSource>();
private FindingStatus _status;
private DateTime? _updatedAt;
/// <summary>
/// Gets and sets the property Action.
/// <para>
/// The action in the analyzed policy statement that an external principal has permission
/// to use.
/// </para>
/// </summary>
public List<string> Action
{
get { return this._action; }
set { this._action = value; }
}
// Check to see if Action property is set
internal bool IsSetAction()
{
return this._action != null && this._action.Count > 0;
}
/// <summary>
/// Gets and sets the property AnalyzedAt.
/// <para>
/// The time at which the resource was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime AnalyzedAt
{
get { return this._analyzedAt.GetValueOrDefault(); }
set { this._analyzedAt = value; }
}
// Check to see if AnalyzedAt property is set
internal bool IsSetAnalyzedAt()
{
return this._analyzedAt.HasValue;
}
/// <summary>
/// Gets and sets the property Condition.
/// <para>
/// The condition in the analyzed policy statement that resulted in a finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, string> Condition
{
get { return this._condition; }
set { this._condition = value; }
}
// Check to see if Condition property is set
internal bool IsSetCondition()
{
return this._condition != null && this._condition.Count > 0;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the finding was generated.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Error.
/// <para>
/// An error.
/// </para>
/// </summary>
public string Error
{
get { return this._error; }
set { this._error = value; }
}
// Check to see if Error property is set
internal bool IsSetError()
{
return this._error != null;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The ID of the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property IsPublic.
/// <para>
/// Indicates whether the policy that generated the finding allows public access to the
/// resource.
/// </para>
/// </summary>
public bool IsPublic
{
get { return this._isPublic.GetValueOrDefault(); }
set { this._isPublic = value; }
}
// Check to see if IsPublic property is set
internal bool IsSetIsPublic()
{
return this._isPublic.HasValue;
}
/// <summary>
/// Gets and sets the property Principal.
/// <para>
/// The external principal that access to a resource within the zone of trust.
/// </para>
/// </summary>
public Dictionary<string, string> Principal
{
get { return this._principal; }
set { this._principal = value; }
}
// Check to see if Principal property is set
internal bool IsSetPrincipal()
{
return this._principal != null && this._principal.Count > 0;
}
/// <summary>
/// Gets and sets the property Resource.
/// <para>
/// The resource that an external principal has access to.
/// </para>
/// </summary>
public string Resource
{
get { return this._resource; }
set { this._resource = value; }
}
// Check to see if Resource property is set
internal bool IsSetResource()
{
return this._resource != null;
}
/// <summary>
/// Gets and sets the property ResourceOwnerAccount.
/// <para>
/// The Amazon Web Services account ID that owns the resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceOwnerAccount
{
get { return this._resourceOwnerAccount; }
set { this._resourceOwnerAccount = value; }
}
// Check to see if ResourceOwnerAccount property is set
internal bool IsSetResourceOwnerAccount()
{
return this._resourceOwnerAccount != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of the resource identified in the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
/// <summary>
/// Gets and sets the property Sources.
/// <para>
/// The sources of the finding. This indicates how the access that generated the finding
/// is granted. It is populated for Amazon S3 bucket findings.
/// </para>
/// </summary>
public List<FindingSource> Sources
{
get { return this._sources; }
set { this._sources = value; }
}
// Check to see if Sources property is set
internal bool IsSetSources()
{
return this._sources != null && this._sources.Count > 0;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The current status of the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public FindingStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property UpdatedAt.
/// <para>
/// The time at which the finding was updated.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime UpdatedAt
{
get { return this._updatedAt.GetValueOrDefault(); }
set { this._updatedAt = value; }
}
// Check to see if UpdatedAt property is set
internal bool IsSetUpdatedAt()
{
return this._updatedAt.HasValue;
}
}
} | 315 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The source of the finding. This indicates how the access that generated the finding
/// is granted. It is populated for Amazon S3 bucket findings.
/// </summary>
public partial class FindingSource
{
private FindingSourceDetail _detail;
private FindingSourceType _type;
/// <summary>
/// Gets and sets the property Detail.
/// <para>
/// Includes details about how the access that generated the finding is granted. This
/// is populated for Amazon S3 bucket findings.
/// </para>
/// </summary>
public FindingSourceDetail Detail
{
get { return this._detail; }
set { this._detail = value; }
}
// Check to see if Detail property is set
internal bool IsSetDetail()
{
return this._detail != null;
}
/// <summary>
/// Gets and sets the property Type.
/// <para>
/// Indicates the type of access that generated the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public FindingSourceType Type
{
get { return this._type; }
set { this._type = value; }
}
// Check to see if Type property is set
internal bool IsSetType()
{
return this._type != null;
}
}
} | 79 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Includes details about how the access that generated the finding is granted. This
/// is populated for Amazon S3 bucket findings.
/// </summary>
public partial class FindingSourceDetail
{
private string _accessPointAccount;
private string _accessPointArn;
/// <summary>
/// Gets and sets the property AccessPointAccount.
/// <para>
/// The account of the cross-account access point that generated the finding.
/// </para>
/// </summary>
public string AccessPointAccount
{
get { return this._accessPointAccount; }
set { this._accessPointAccount = value; }
}
// Check to see if AccessPointAccount property is set
internal bool IsSetAccessPointAccount()
{
return this._accessPointAccount != null;
}
/// <summary>
/// Gets and sets the property AccessPointArn.
/// <para>
/// The ARN of the access point that generated the finding. The ARN format depends on
/// whether the ARN represents an access point or a multi-region access point.
/// </para>
/// </summary>
public string AccessPointArn
{
get { return this._accessPointArn; }
set { this._accessPointArn = value; }
}
// Check to see if AccessPointArn property is set
internal bool IsSetAccessPointArn()
{
return this._accessPointArn != null;
}
}
} | 78 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains information about a finding.
/// </summary>
public partial class FindingSummary
{
private List<string> _action = new List<string>();
private DateTime? _analyzedAt;
private Dictionary<string, string> _condition = new Dictionary<string, string>();
private DateTime? _createdAt;
private string _error;
private string _id;
private bool? _isPublic;
private Dictionary<string, string> _principal = new Dictionary<string, string>();
private string _resource;
private string _resourceOwnerAccount;
private ResourceType _resourceType;
private List<FindingSource> _sources = new List<FindingSource>();
private FindingStatus _status;
private DateTime? _updatedAt;
/// <summary>
/// Gets and sets the property Action.
/// <para>
/// The action in the analyzed policy statement that an external principal has permission
/// to use.
/// </para>
/// </summary>
public List<string> Action
{
get { return this._action; }
set { this._action = value; }
}
// Check to see if Action property is set
internal bool IsSetAction()
{
return this._action != null && this._action.Count > 0;
}
/// <summary>
/// Gets and sets the property AnalyzedAt.
/// <para>
/// The time at which the resource-based policy that generated the finding was analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime AnalyzedAt
{
get { return this._analyzedAt.GetValueOrDefault(); }
set { this._analyzedAt = value; }
}
// Check to see if AnalyzedAt property is set
internal bool IsSetAnalyzedAt()
{
return this._analyzedAt.HasValue;
}
/// <summary>
/// Gets and sets the property Condition.
/// <para>
/// The condition in the analyzed policy statement that resulted in a finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, string> Condition
{
get { return this._condition; }
set { this._condition = value; }
}
// Check to see if Condition property is set
internal bool IsSetCondition()
{
return this._condition != null && this._condition.Count > 0;
}
/// <summary>
/// Gets and sets the property CreatedAt.
/// <para>
/// The time at which the finding was created.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime CreatedAt
{
get { return this._createdAt.GetValueOrDefault(); }
set { this._createdAt = value; }
}
// Check to see if CreatedAt property is set
internal bool IsSetCreatedAt()
{
return this._createdAt.HasValue;
}
/// <summary>
/// Gets and sets the property Error.
/// <para>
/// The error that resulted in an Error finding.
/// </para>
/// </summary>
public string Error
{
get { return this._error; }
set { this._error = value; }
}
// Check to see if Error property is set
internal bool IsSetError()
{
return this._error != null;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The ID of the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
/// <summary>
/// Gets and sets the property IsPublic.
/// <para>
/// Indicates whether the finding reports a resource that has a policy that allows public
/// access.
/// </para>
/// </summary>
public bool IsPublic
{
get { return this._isPublic.GetValueOrDefault(); }
set { this._isPublic = value; }
}
// Check to see if IsPublic property is set
internal bool IsSetIsPublic()
{
return this._isPublic.HasValue;
}
/// <summary>
/// Gets and sets the property Principal.
/// <para>
/// The external principal that has access to a resource within the zone of trust.
/// </para>
/// </summary>
public Dictionary<string, string> Principal
{
get { return this._principal; }
set { this._principal = value; }
}
// Check to see if Principal property is set
internal bool IsSetPrincipal()
{
return this._principal != null && this._principal.Count > 0;
}
/// <summary>
/// Gets and sets the property Resource.
/// <para>
/// The resource that the external principal has access to.
/// </para>
/// </summary>
public string Resource
{
get { return this._resource; }
set { this._resource = value; }
}
// Check to see if Resource property is set
internal bool IsSetResource()
{
return this._resource != null;
}
/// <summary>
/// Gets and sets the property ResourceOwnerAccount.
/// <para>
/// The Amazon Web Services account ID that owns the resource.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceOwnerAccount
{
get { return this._resourceOwnerAccount; }
set { this._resourceOwnerAccount = value; }
}
// Check to see if ResourceOwnerAccount property is set
internal bool IsSetResourceOwnerAccount()
{
return this._resourceOwnerAccount != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of the resource that the external principal has access to.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
/// <summary>
/// Gets and sets the property Sources.
/// <para>
/// The sources of the finding. This indicates how the access that generated the finding
/// is granted. It is populated for Amazon S3 bucket findings.
/// </para>
/// </summary>
public List<FindingSource> Sources
{
get { return this._sources; }
set { this._sources = value; }
}
// Check to see if Sources property is set
internal bool IsSetSources()
{
return this._sources != null && this._sources.Count > 0;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The status of the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public FindingStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
/// <summary>
/// Gets and sets the property UpdatedAt.
/// <para>
/// The time at which the finding was most recently updated.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime UpdatedAt
{
get { return this._updatedAt.GetValueOrDefault(); }
set { this._updatedAt = value; }
}
// Check to see if UpdatedAt property is set
internal bool IsSetUpdatedAt()
{
return this._updatedAt.HasValue;
}
}
} | 315 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains the text for the generated policy.
/// </summary>
public partial class GeneratedPolicy
{
private string _policy;
/// <summary>
/// Gets and sets the property Policy.
/// <para>
/// The text to use as the content for the new policy. The policy is created using the
/// <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html">CreatePolicy</a>
/// action.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Policy
{
get { return this._policy; }
set { this._policy = value; }
}
// Check to see if Policy property is set
internal bool IsSetPolicy()
{
return this._policy != null;
}
}
} | 60 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains the generated policy details.
/// </summary>
public partial class GeneratedPolicyProperties
{
private CloudTrailProperties _cloudTrailProperties;
private bool? _isComplete;
private string _principalArn;
/// <summary>
/// Gets and sets the property CloudTrailProperties.
/// <para>
/// Lists details about the <code>Trail</code> used to generated policy.
/// </para>
/// </summary>
public CloudTrailProperties CloudTrailProperties
{
get { return this._cloudTrailProperties; }
set { this._cloudTrailProperties = value; }
}
// Check to see if CloudTrailProperties property is set
internal bool IsSetCloudTrailProperties()
{
return this._cloudTrailProperties != null;
}
/// <summary>
/// Gets and sets the property IsComplete.
/// <para>
/// This value is set to <code>true</code> if the generated policy contains all possible
/// actions for a service that IAM Access Analyzer identified from the CloudTrail trail
/// that you specified, and <code>false</code> otherwise.
/// </para>
/// </summary>
public bool IsComplete
{
get { return this._isComplete.GetValueOrDefault(); }
set { this._isComplete = value; }
}
// Check to see if IsComplete property is set
internal bool IsSetIsComplete()
{
return this._isComplete.HasValue;
}
/// <summary>
/// Gets and sets the property PrincipalArn.
/// <para>
/// The ARN of the IAM entity (user or role) for which you are generating a policy.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string PrincipalArn
{
get { return this._principalArn; }
set { this._principalArn = value; }
}
// Check to see if PrincipalArn property is set
internal bool IsSetPrincipalArn()
{
return this._principalArn != null;
}
}
} | 98 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains the text for the generated policy and its details.
/// </summary>
public partial class GeneratedPolicyResult
{
private List<GeneratedPolicy> _generatedPolicies = new List<GeneratedPolicy>();
private GeneratedPolicyProperties _properties;
/// <summary>
/// Gets and sets the property GeneratedPolicies.
/// <para>
/// The text to use as the content for the new policy. The policy is created using the
/// <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html">CreatePolicy</a>
/// action.
/// </para>
/// </summary>
public List<GeneratedPolicy> GeneratedPolicies
{
get { return this._generatedPolicies; }
set { this._generatedPolicies = value; }
}
// Check to see if GeneratedPolicies property is set
internal bool IsSetGeneratedPolicies()
{
return this._generatedPolicies != null && this._generatedPolicies.Count > 0;
}
/// <summary>
/// Gets and sets the property Properties.
/// <para>
/// A <code>GeneratedPolicyProperties</code> object that contains properties of the generated
/// policy.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public GeneratedPolicyProperties Properties
{
get { return this._properties; }
set { this._properties = value; }
}
// Check to see if Properties property is set
internal bool IsSetProperties()
{
return this._properties != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetAccessPreview operation.
/// Retrieves information about an access preview for the specified analyzer.
/// </summary>
public partial class GetAccessPreviewRequest : AmazonAccessAnalyzerRequest
{
private string _accessPreviewId;
private string _analyzerArn;
/// <summary>
/// Gets and sets the property AccessPreviewId.
/// <para>
/// The unique ID for the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AccessPreviewId
{
get { return this._accessPreviewId; }
set { this._accessPreviewId = value; }
}
// Check to see if AccessPreviewId property is set
internal bool IsSetAccessPreviewId()
{
return this._accessPreviewId != null;
}
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> used to generate the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the GetAccessPreview operation.
/// </summary>
public partial class GetAccessPreviewResponse : AmazonWebServiceResponse
{
private AccessPreview _accessPreview;
/// <summary>
/// Gets and sets the property AccessPreview.
/// <para>
/// An object that contains information about the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public AccessPreview AccessPreview
{
get { return this._accessPreview; }
set { this._accessPreview = value; }
}
// Check to see if AccessPreview property is set
internal bool IsSetAccessPreview()
{
return this._accessPreview != null;
}
}
} | 58 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetAnalyzedResource operation.
/// Retrieves information about a resource that was analyzed.
/// </summary>
public partial class GetAnalyzedResourceRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private string _resourceArn;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> to retrieve information from.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property ResourceArn.
/// <para>
/// The ARN of the resource to retrieve information about.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ResourceArn
{
get { return this._resourceArn; }
set { this._resourceArn = value; }
}
// Check to see if ResourceArn property is set
internal bool IsSetResourceArn()
{
return this._resourceArn != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class GetAnalyzedResourceResponse : AmazonWebServiceResponse
{
private AnalyzedResource _resource;
/// <summary>
/// Gets and sets the property Resource.
/// <para>
/// An <code>AnalyzedResource</code> object that contains information that IAM Access
/// Analyzer found when it analyzed the resource.
/// </para>
/// </summary>
public AnalyzedResource Resource
{
get { return this._resource; }
set { this._resource = value; }
}
// Check to see if Resource property is set
internal bool IsSetResource()
{
return this._resource != null;
}
}
} | 58 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetAnalyzer operation.
/// Retrieves information about the specified analyzer.
/// </summary>
public partial class GetAnalyzerRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer retrieved.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
}
} | 59 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class GetAnalyzerResponse : AmazonWebServiceResponse
{
private AnalyzerSummary _analyzer;
/// <summary>
/// Gets and sets the property Analyzer.
/// <para>
/// An <code>AnalyzerSummary</code> object that contains information about the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public AnalyzerSummary Analyzer
{
get { return this._analyzer; }
set { this._analyzer = value; }
}
// Check to see if Analyzer property is set
internal bool IsSetAnalyzer()
{
return this._analyzer != null;
}
}
} | 58 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetArchiveRule operation.
/// Retrieves information about an archive rule.
///
///
/// <para>
/// To learn about filter keys that you can use to create an archive rule, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM
/// Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.
/// </para>
/// </summary>
public partial class GetArchiveRuleRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private string _ruleName;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer to retrieve rules from.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the rule to retrieve.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
}
} | 85 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class GetArchiveRuleResponse : AmazonWebServiceResponse
{
private ArchiveRuleSummary _archiveRule;
/// <summary>
/// Gets and sets the property ArchiveRule.
/// </summary>
[AWSProperty(Required=true)]
public ArchiveRuleSummary ArchiveRule
{
get { return this._archiveRule; }
set { this._archiveRule = value; }
}
// Check to see if ArchiveRule property is set
internal bool IsSetArchiveRule()
{
return this._archiveRule != null;
}
}
} | 55 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetFinding operation.
/// Retrieves information about the specified finding.
/// </summary>
public partial class GetFindingRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private string _id;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> that generated the finding.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property Id.
/// <para>
/// The ID of the finding to retrieve.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Id
{
get { return this._id; }
set { this._id = value; }
}
// Check to see if Id property is set
internal bool IsSetId()
{
return this._id != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class GetFindingResponse : AmazonWebServiceResponse
{
private Finding _finding;
/// <summary>
/// Gets and sets the property Finding.
/// <para>
/// A <code>finding</code> object that contains finding details.
/// </para>
/// </summary>
public Finding Finding
{
get { return this._finding; }
set { this._finding = value; }
}
// Check to see if Finding property is set
internal bool IsSetFinding()
{
return this._finding != null;
}
}
} | 57 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the GetGeneratedPolicy operation.
/// Retrieves the policy that was generated using <code>StartPolicyGeneration</code>.
/// </summary>
public partial class GetGeneratedPolicyRequest : AmazonAccessAnalyzerRequest
{
private bool? _includeResourcePlaceholders;
private bool? _includeServiceLevelTemplate;
private string _jobId;
/// <summary>
/// Gets and sets the property IncludeResourcePlaceholders.
/// <para>
/// The level of detail that you want to generate. You can specify whether to generate
/// policies with placeholders for resource ARNs for actions that support resource level
/// granularity in policies.
/// </para>
///
/// <para>
/// For example, in the resource section of a policy, you can receive a placeholder such
/// as <code>"Resource":"arn:aws:s3:::${BucketName}"</code> instead of <code>"*"</code>.
/// </para>
/// </summary>
public bool IncludeResourcePlaceholders
{
get { return this._includeResourcePlaceholders.GetValueOrDefault(); }
set { this._includeResourcePlaceholders = value; }
}
// Check to see if IncludeResourcePlaceholders property is set
internal bool IsSetIncludeResourcePlaceholders()
{
return this._includeResourcePlaceholders.HasValue;
}
/// <summary>
/// Gets and sets the property IncludeServiceLevelTemplate.
/// <para>
/// The level of detail that you want to generate. You can specify whether to generate
/// service-level policies.
/// </para>
///
/// <para>
/// IAM Access Analyzer uses <code>iam:servicelastaccessed</code> to identify services
/// that have been used recently to create this service-level template.
/// </para>
/// </summary>
public bool IncludeServiceLevelTemplate
{
get { return this._includeServiceLevelTemplate.GetValueOrDefault(); }
set { this._includeServiceLevelTemplate = value; }
}
// Check to see if IncludeServiceLevelTemplate property is set
internal bool IsSetIncludeServiceLevelTemplate()
{
return this._includeServiceLevelTemplate.HasValue;
}
/// <summary>
/// Gets and sets the property JobId.
/// <para>
/// The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code>
/// operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code>
/// to retrieve the generated policies or used with <code>CancelPolicyGeneration</code>
/// to cancel the policy generation request.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string JobId
{
get { return this._jobId; }
set { this._jobId = value; }
}
// Check to see if JobId property is set
internal bool IsSetJobId()
{
return this._jobId != null;
}
}
} | 113 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the GetGeneratedPolicy operation.
/// </summary>
public partial class GetGeneratedPolicyResponse : AmazonWebServiceResponse
{
private GeneratedPolicyResult _generatedPolicyResult;
private JobDetails _jobDetails;
/// <summary>
/// Gets and sets the property GeneratedPolicyResult.
/// <para>
/// A <code>GeneratedPolicyResult</code> object that contains the generated policies and
/// associated details.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public GeneratedPolicyResult GeneratedPolicyResult
{
get { return this._generatedPolicyResult; }
set { this._generatedPolicyResult = value; }
}
// Check to see if GeneratedPolicyResult property is set
internal bool IsSetGeneratedPolicyResult()
{
return this._generatedPolicyResult != null;
}
/// <summary>
/// Gets and sets the property JobDetails.
/// <para>
/// A <code>GeneratedPolicyDetails</code> object that contains details about the generated
/// policy.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public JobDetails JobDetails
{
get { return this._jobDetails; }
set { this._jobDetails = value; }
}
// Check to see if JobDetails property is set
internal bool IsSetJobDetails()
{
return this._jobDetails != null;
}
}
} | 80 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The proposed access control configuration for an IAM role. You can propose a configuration
/// for a new IAM role or an existing IAM role that you own by specifying the trust policy.
/// If the configuration is for a new IAM role, you must specify the trust policy. If
/// the configuration is for an existing IAM role that you own and you do not propose
/// the trust policy, the access preview uses the existing trust policy for the role.
/// The proposed trust policy cannot be an empty string. For more information about role
/// trust policy limits, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html">IAM
/// and STS quotas</a>.
/// </summary>
public partial class IamRoleConfiguration
{
private string _trustPolicy;
/// <summary>
/// Gets and sets the property TrustPolicy.
/// <para>
/// The proposed trust policy for the IAM role.
/// </para>
/// </summary>
public string TrustPolicy
{
get { return this._trustPolicy; }
set { this._trustPolicy = value; }
}
// Check to see if TrustPolicy property is set
internal bool IsSetTrustPolicy()
{
return this._trustPolicy != null;
}
}
} | 64 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// An criterion statement in an archive rule. Each archive rule may have multiple criteria.
/// </summary>
public partial class InlineArchiveRule
{
private Dictionary<string, Criterion> _filter = new Dictionary<string, Criterion>();
private string _ruleName;
/// <summary>
/// Gets and sets the property Filter.
/// <para>
/// The condition and values for a criterion.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public Dictionary<string, Criterion> Filter
{
get { return this._filter; }
set { this._filter = value; }
}
// Check to see if Filter property is set
internal bool IsSetFilter()
{
return this._filter != null && this._filter.Count > 0;
}
/// <summary>
/// Gets and sets the property RuleName.
/// <para>
/// The name of the rule.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
}
} | 78 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Internal server error.
/// </summary>
#if !NETSTANDARD
[Serializable]
#endif
public partial class InternalServerException : AmazonAccessAnalyzerException
{
private int? _retryAfterSeconds;
private RetryableDetails _retryableDetails = new RetryableDetails(false);
/// <summary>
/// Constructs a new InternalServerException with the specified error
/// message.
/// </summary>
/// <param name="message">
/// Describes the error encountered.
/// </param>
public InternalServerException(string message)
: base(message) {}
/// <summary>
/// Construct instance of InternalServerException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
public InternalServerException(string message, Exception innerException)
: base(message, innerException) {}
/// <summary>
/// Construct instance of InternalServerException
/// </summary>
/// <param name="innerException"></param>
public InternalServerException(Exception innerException)
: base(innerException) {}
/// <summary>
/// Construct instance of InternalServerException
/// </summary>
/// <param name="message"></param>
/// <param name="innerException"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public InternalServerException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, innerException, errorType, errorCode, requestId, statusCode) {}
/// <summary>
/// Construct instance of InternalServerException
/// </summary>
/// <param name="message"></param>
/// <param name="errorType"></param>
/// <param name="errorCode"></param>
/// <param name="requestId"></param>
/// <param name="statusCode"></param>
public InternalServerException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode)
: base(message, errorType, errorCode, requestId, statusCode) {}
#if !NETSTANDARD
/// <summary>
/// Constructs a new instance of the InternalServerException class with serialized data.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception>
protected InternalServerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
this.RetryAfterSeconds = (int)info.GetValue("RetryAfterSeconds", typeof(int));
}
/// <summary>
/// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception>
#if BCL35
[System.Security.Permissions.SecurityPermission(
System.Security.Permissions.SecurityAction.LinkDemand,
Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)]
#endif
[System.Security.SecurityCritical]
// These FxCop rules are giving false-positives for this method
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")]
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("RetryAfterSeconds", this.RetryAfterSeconds);
}
#endif
/// <summary>
/// Gets and sets the property RetryAfterSeconds.
/// <para>
/// The seconds to wait to retry.
/// </para>
/// </summary>
public int RetryAfterSeconds
{
get { return this._retryAfterSeconds.GetValueOrDefault(); }
set { this._retryAfterSeconds = value; }
}
// Check to see if RetryAfterSeconds property is set
internal bool IsSetRetryAfterSeconds()
{
return this._retryAfterSeconds.HasValue;
}
/// <summary>
/// Flag indicating if the exception is retryable and the associated retry
/// details. A null value indicates that the exception is not retryable.
/// </summary>
public override RetryableDetails Retryable
{
get
{
return _retryableDetails;
}
}
}
} | 158 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This configuration sets the network origin for the Amazon S3 access point or multi-region
/// access point to <code>Internet</code>.
/// </summary>
public partial class InternetConfiguration
{
}
} | 39 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains details about the policy generation request.
/// </summary>
public partial class JobDetails
{
private DateTime? _completedOn;
private JobError _jobError;
private string _jobId;
private DateTime? _startedOn;
private JobStatus _status;
/// <summary>
/// Gets and sets the property CompletedOn.
/// <para>
/// A timestamp of when the job was completed.
/// </para>
/// </summary>
public DateTime CompletedOn
{
get { return this._completedOn.GetValueOrDefault(); }
set { this._completedOn = value; }
}
// Check to see if CompletedOn property is set
internal bool IsSetCompletedOn()
{
return this._completedOn.HasValue;
}
/// <summary>
/// Gets and sets the property JobError.
/// <para>
/// The job error for the policy generation request.
/// </para>
/// </summary>
public JobError JobError
{
get { return this._jobError; }
set { this._jobError = value; }
}
// Check to see if JobError property is set
internal bool IsSetJobError()
{
return this._jobError != null;
}
/// <summary>
/// Gets and sets the property JobId.
/// <para>
/// The <code>JobId</code> that is returned by the <code>StartPolicyGeneration</code>
/// operation. The <code>JobId</code> can be used with <code>GetGeneratedPolicy</code>
/// to retrieve the generated policies or used with <code>CancelPolicyGeneration</code>
/// to cancel the policy generation request.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string JobId
{
get { return this._jobId; }
set { this._jobId = value; }
}
// Check to see if JobId property is set
internal bool IsSetJobId()
{
return this._jobId != null;
}
/// <summary>
/// Gets and sets the property StartedOn.
/// <para>
/// A timestamp of when the job was started.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public DateTime StartedOn
{
get { return this._startedOn.GetValueOrDefault(); }
set { this._startedOn = value; }
}
// Check to see if StartedOn property is set
internal bool IsSetStartedOn()
{
return this._startedOn.HasValue;
}
/// <summary>
/// Gets and sets the property Status.
/// <para>
/// The status of the job request.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public JobStatus Status
{
get { return this._status; }
set { this._status = value; }
}
// Check to see if Status property is set
internal bool IsSetStatus()
{
return this._status != null;
}
}
} | 139 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Contains the details about the policy generation error.
/// </summary>
public partial class JobError
{
private JobErrorCode _code;
private string _message;
/// <summary>
/// Gets and sets the property Code.
/// <para>
/// The job error code.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public JobErrorCode Code
{
get { return this._code; }
set { this._code = value; }
}
// Check to see if Code property is set
internal bool IsSetCode()
{
return this._code != null;
}
/// <summary>
/// Gets and sets the property Message.
/// <para>
/// Specific information about the error. For example, which service quota was exceeded
/// or which resource was not found.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string Message
{
get { return this._message; }
set { this._message = value; }
}
// Check to see if Message property is set
internal bool IsSetMessage()
{
return this._message != null;
}
}
} | 79 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// A proposed grant configuration for a KMS key. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html">CreateGrant</a>.
/// </summary>
public partial class KmsGrantConfiguration
{
private KmsGrantConstraints _constraints;
private string _granteePrincipal;
private string _issuingAccount;
private List<string> _operations = new List<string>();
private string _retiringPrincipal;
/// <summary>
/// Gets and sets the property Constraints.
/// <para>
/// Use this structure to propose allowing <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic
/// operations</a> in the grant only when the operation request includes the specified
/// <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">encryption
/// context</a>.
/// </para>
/// </summary>
public KmsGrantConstraints Constraints
{
get { return this._constraints; }
set { this._constraints = value; }
}
// Check to see if Constraints property is set
internal bool IsSetConstraints()
{
return this._constraints != null;
}
/// <summary>
/// Gets and sets the property GranteePrincipal.
/// <para>
/// The principal that is given permission to perform the operations that the grant permits.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string GranteePrincipal
{
get { return this._granteePrincipal; }
set { this._granteePrincipal = value; }
}
// Check to see if GranteePrincipal property is set
internal bool IsSetGranteePrincipal()
{
return this._granteePrincipal != null;
}
/// <summary>
/// Gets and sets the property IssuingAccount.
/// <para>
/// The Amazon Web Services account under which the grant was issued. The account is
/// used to propose KMS grants issued by accounts other than the owner of the key.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string IssuingAccount
{
get { return this._issuingAccount; }
set { this._issuingAccount = value; }
}
// Check to see if IssuingAccount property is set
internal bool IsSetIssuingAccount()
{
return this._issuingAccount != null;
}
/// <summary>
/// Gets and sets the property Operations.
/// <para>
/// A list of operations that the grant permits.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<string> Operations
{
get { return this._operations; }
set { this._operations = value; }
}
// Check to see if Operations property is set
internal bool IsSetOperations()
{
return this._operations != null && this._operations.Count > 0;
}
/// <summary>
/// Gets and sets the property RetiringPrincipal.
/// <para>
/// The principal that is given permission to retire the grant by using <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_RetireGrant.html">RetireGrant</a>
/// operation.
/// </para>
/// </summary>
public string RetiringPrincipal
{
get { return this._retiringPrincipal; }
set { this._retiringPrincipal = value; }
}
// Check to see if RetiringPrincipal property is set
internal bool IsSetRetiringPrincipal()
{
return this._retiringPrincipal != null;
}
}
} | 141 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Use this structure to propose allowing <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic
/// operations</a> in the grant only when the operation request includes the specified
/// <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context">encryption
/// context</a>. You can specify only one type of encryption context. An empty map is
/// treated as not specified. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_GrantConstraints.html">GrantConstraints</a>.
/// </summary>
public partial class KmsGrantConstraints
{
private Dictionary<string, string> _encryptionContextEquals = new Dictionary<string, string>();
private Dictionary<string, string> _encryptionContextSubset = new Dictionary<string, string>();
/// <summary>
/// Gets and sets the property EncryptionContextEquals.
/// <para>
/// A list of key-value pairs that must match the encryption context in the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic
/// operation</a> request. The grant allows the operation only when the encryption context
/// in the request is the same as the encryption context specified in this constraint.
/// </para>
/// </summary>
public Dictionary<string, string> EncryptionContextEquals
{
get { return this._encryptionContextEquals; }
set { this._encryptionContextEquals = value; }
}
// Check to see if EncryptionContextEquals property is set
internal bool IsSetEncryptionContextEquals()
{
return this._encryptionContextEquals != null && this._encryptionContextEquals.Count > 0;
}
/// <summary>
/// Gets and sets the property EncryptionContextSubset.
/// <para>
/// A list of key-value pairs that must be included in the encryption context of the <a
/// href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations">cryptographic
/// operation</a> request. The grant allows the cryptographic operation only when the
/// encryption context in the request includes the key-value pairs specified in this constraint,
/// although it can include additional key-value pairs.
/// </para>
/// </summary>
public Dictionary<string, string> EncryptionContextSubset
{
get { return this._encryptionContextSubset; }
set { this._encryptionContextSubset = value; }
}
// Check to see if EncryptionContextSubset property is set
internal bool IsSetEncryptionContextSubset()
{
return this._encryptionContextSubset != null && this._encryptionContextSubset.Count > 0;
}
}
} | 86 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Proposed access control configuration for a KMS key. You can propose a configuration
/// for a new KMS key or an existing KMS key that you own by specifying the key policy
/// and KMS grant configuration. If the configuration is for an existing key and you do
/// not specify the key policy, the access preview uses the existing policy for the key.
/// If the access preview is for a new resource and you do not specify the key policy,
/// then the access preview uses the default key policy. The proposed key policy cannot
/// be an empty string. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default">Default
/// key policy</a>. For more information about key policy limits, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html">Resource
/// quotas</a>.
/// </summary>
public partial class KmsKeyConfiguration
{
private List<KmsGrantConfiguration> _grants = new List<KmsGrantConfiguration>();
private Dictionary<string, string> _keyPolicies = new Dictionary<string, string>();
/// <summary>
/// Gets and sets the property Grants.
/// <para>
/// A list of proposed grant configurations for the KMS key. If the proposed grant configuration
/// is for an existing key, the access preview uses the proposed list of grant configurations
/// in place of the existing grants. Otherwise, the access preview uses the existing grants
/// for the key.
/// </para>
/// </summary>
public List<KmsGrantConfiguration> Grants
{
get { return this._grants; }
set { this._grants = value; }
}
// Check to see if Grants property is set
internal bool IsSetGrants()
{
return this._grants != null && this._grants.Count > 0;
}
/// <summary>
/// Gets and sets the property KeyPolicies.
/// <para>
/// Resource policy configuration for the KMS key. The only valid value for the name of
/// the key policy is <code>default</code>. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default">Default
/// key policy</a>.
/// </para>
/// </summary>
public Dictionary<string, string> KeyPolicies
{
get { return this._keyPolicies; }
set { this._keyPolicies = value; }
}
// Check to see if KeyPolicies property is set
internal bool IsSetKeyPolicies()
{
return this._keyPolicies != null && this._keyPolicies.Count > 0;
}
}
} | 89 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListAccessPreviewFindings operation.
/// Retrieves a list of access preview findings generated by the specified access preview.
/// </summary>
public partial class ListAccessPreviewFindingsRequest : AmazonAccessAnalyzerRequest
{
private string _accessPreviewId;
private string _analyzerArn;
private Dictionary<string, Criterion> _filter = new Dictionary<string, Criterion>();
private int? _maxResults;
private string _nextToken;
/// <summary>
/// Gets and sets the property AccessPreviewId.
/// <para>
/// The unique ID for the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AccessPreviewId
{
get { return this._accessPreviewId; }
set { this._accessPreviewId = value; }
}
// Check to see if AccessPreviewId property is set
internal bool IsSetAccessPreviewId()
{
return this._accessPreviewId != null;
}
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> used to generate the access.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property Filter.
/// <para>
/// Criteria to filter the returned findings.
/// </para>
/// </summary>
public Dictionary<string, Criterion> Filter
{
get { return this._filter; }
set { this._filter = value; }
}
// Check to see if Filter property is set
internal bool IsSetFilter()
{
return this._filter != null && this._filter.Count > 0;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the response.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 137 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the ListAccessPreviewFindings operation.
/// </summary>
public partial class ListAccessPreviewFindingsResponse : AmazonWebServiceResponse
{
private List<AccessPreviewFinding> _findings = new List<AccessPreviewFinding>();
private string _nextToken;
/// <summary>
/// Gets and sets the property Findings.
/// <para>
/// A list of access preview findings that match the specified filter criteria.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<AccessPreviewFinding> Findings
{
get { return this._findings; }
set { this._findings = value; }
}
// Check to see if Findings property is set
internal bool IsSetFindings()
{
return this._findings != null && this._findings.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListAccessPreviews operation.
/// Retrieves a list of access previews for the specified analyzer.
/// </summary>
public partial class ListAccessPreviewsRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private int? _maxResults;
private string _nextToken;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> used to generate the access preview.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the response.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 98 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// This is the response object from the ListAccessPreviews operation.
/// </summary>
public partial class ListAccessPreviewsResponse : AmazonWebServiceResponse
{
private List<AccessPreviewSummary> _accessPreviews = new List<AccessPreviewSummary>();
private string _nextToken;
/// <summary>
/// Gets and sets the property AccessPreviews.
/// <para>
/// A list of access previews retrieved for the analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<AccessPreviewSummary> AccessPreviews
{
get { return this._accessPreviews; }
set { this._accessPreviews = value; }
}
// Check to see if AccessPreviews property is set
internal bool IsSetAccessPreviews()
{
return this._accessPreviews != null && this._accessPreviews.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListAnalyzedResources operation.
/// Retrieves a list of resources of the specified type that have been analyzed by the
/// specified analyzer..
/// </summary>
public partial class ListAnalyzedResourcesRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private int? _maxResults;
private string _nextToken;
private ResourceType _resourceType;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> to retrieve a list of analyzed resources from.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the response.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
/// <summary>
/// Gets and sets the property ResourceType.
/// <para>
/// The type of resource.
/// </para>
/// </summary>
public ResourceType ResourceType
{
get { return this._resourceType; }
set { this._resourceType = value; }
}
// Check to see if ResourceType property is set
internal bool IsSetResourceType()
{
return this._resourceType != null;
}
}
} | 118 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class ListAnalyzedResourcesResponse : AmazonWebServiceResponse
{
private List<AnalyzedResourceSummary> _analyzedResources = new List<AnalyzedResourceSummary>();
private string _nextToken;
/// <summary>
/// Gets and sets the property AnalyzedResources.
/// <para>
/// A list of resources that were analyzed.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<AnalyzedResourceSummary> AnalyzedResources
{
get { return this._analyzedResources; }
set { this._analyzedResources = value; }
}
// Check to see if AnalyzedResources property is set
internal bool IsSetAnalyzedResources()
{
return this._analyzedResources != null && this._analyzedResources.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListAnalyzers operation.
/// Retrieves a list of analyzers.
/// </summary>
public partial class ListAnalyzersRequest : AmazonAccessAnalyzerRequest
{
private int? _maxResults;
private string _nextToken;
private Type _type;
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the response.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
/// <summary>
/// Gets and sets the property Type.
/// <para>
/// The type of analyzer.
/// </para>
/// </summary>
public Type Type
{
get { return this._type; }
set { this._type = value; }
}
// Check to see if Type property is set
internal bool IsSetType()
{
return this._type != null;
}
}
} | 96 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class ListAnalyzersResponse : AmazonWebServiceResponse
{
private List<AnalyzerSummary> _analyzers = new List<AnalyzerSummary>();
private string _nextToken;
/// <summary>
/// Gets and sets the property Analyzers.
/// <para>
/// The analyzers retrieved.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<AnalyzerSummary> Analyzers
{
get { return this._analyzers; }
set { this._analyzers = value; }
}
// Check to see if Analyzers property is set
internal bool IsSetAnalyzers()
{
return this._analyzers != null && this._analyzers.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListArchiveRules operation.
/// Retrieves a list of archive rules created for the specified analyzer.
/// </summary>
public partial class ListArchiveRulesRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerName;
private int? _maxResults;
private string _nextToken;
/// <summary>
/// Gets and sets the property AnalyzerName.
/// <para>
/// The name of the analyzer to retrieve rules from.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=1, Max=255)]
public string AnalyzerName
{
get { return this._analyzerName; }
set { this._analyzerName = value; }
}
// Check to see if AnalyzerName property is set
internal bool IsSetAnalyzerName()
{
return this._analyzerName != null;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the request.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 97 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class ListArchiveRulesResponse : AmazonWebServiceResponse
{
private List<ArchiveRuleSummary> _archiveRules = new List<ArchiveRuleSummary>();
private string _nextToken;
/// <summary>
/// Gets and sets the property ArchiveRules.
/// <para>
/// A list of archive rules created for the specified analyzer.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<ArchiveRuleSummary> ArchiveRules
{
get { return this._archiveRules; }
set { this._archiveRules = value; }
}
// Check to see if ArchiveRules property is set
internal bool IsSetArchiveRules()
{
return this._archiveRules != null && this._archiveRules.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 77 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// Container for the parameters to the ListFindings operation.
/// Retrieves a list of findings generated by the specified analyzer.
///
///
/// <para>
/// To learn about filter keys that you can use to retrieve a list of findings, see <a
/// href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM
/// Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.
/// </para>
/// </summary>
public partial class ListFindingsRequest : AmazonAccessAnalyzerRequest
{
private string _analyzerArn;
private Dictionary<string, Criterion> _filter = new Dictionary<string, Criterion>();
private int? _maxResults;
private string _nextToken;
private SortCriteria _sort;
/// <summary>
/// Gets and sets the property AnalyzerArn.
/// <para>
/// The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#permission-resources">ARN
/// of the analyzer</a> to retrieve findings from.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string AnalyzerArn
{
get { return this._analyzerArn; }
set { this._analyzerArn = value; }
}
// Check to see if AnalyzerArn property is set
internal bool IsSetAnalyzerArn()
{
return this._analyzerArn != null;
}
/// <summary>
/// Gets and sets the property Filter.
/// <para>
/// A filter to match for the findings to return.
/// </para>
/// </summary>
public Dictionary<string, Criterion> Filter
{
get { return this._filter; }
set { this._filter = value; }
}
// Check to see if Filter property is set
internal bool IsSetFilter()
{
return this._filter != null && this._filter.Count > 0;
}
/// <summary>
/// Gets and sets the property MaxResults.
/// <para>
/// The maximum number of results to return in the response.
/// </para>
/// </summary>
public int MaxResults
{
get { return this._maxResults.GetValueOrDefault(); }
set { this._maxResults = value; }
}
// Check to see if MaxResults property is set
internal bool IsSetMaxResults()
{
return this._maxResults.HasValue;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
/// <summary>
/// Gets and sets the property Sort.
/// <para>
/// The sort order for the findings returned.
/// </para>
/// </summary>
public SortCriteria Sort
{
get { return this._sort; }
set { this._sort = value; }
}
// Check to see if Sort property is set
internal bool IsSetSort()
{
return this._sort != null;
}
}
} | 143 |
aws-sdk-net | aws | 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 accessanalyzer-2019-11-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AccessAnalyzer.Model
{
/// <summary>
/// The response to the request.
/// </summary>
public partial class ListFindingsResponse : AmazonWebServiceResponse
{
private List<FindingSummary> _findings = new List<FindingSummary>();
private string _nextToken;
/// <summary>
/// Gets and sets the property Findings.
/// <para>
/// A list of findings retrieved from the analyzer that match the filter criteria specified,
/// if any.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public List<FindingSummary> Findings
{
get { return this._findings; }
set { this._findings = value; }
}
// Check to see if Findings property is set
internal bool IsSetFindings()
{
return this._findings != null && this._findings.Count > 0;
}
/// <summary>
/// Gets and sets the property NextToken.
/// <para>
/// A token used for pagination of results returned.
/// </para>
/// </summary>
public string NextToken
{
get { return this._nextToken; }
set { this._nextToken = value; }
}
// Check to see if NextToken property is set
internal bool IsSetNextToken()
{
return this._nextToken != null;
}
}
} | 78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.