Show / Hide Table of Contents

Class Size

Represents the amount of digital storage.

Inheritance
System.Object
Size
Namespace: Amazon.CDK
Assembly: Amazon.CDK.dll
Syntax (csharp)
public class Size : DeputyBase
Syntax (vb)
Public Class Size
    Inherits DeputyBase
Remarks

The amount can be specified either as a literal value (e.g: 10) which cannot be negative, or as an unresolved number token.

When the amount is passed as a token, unit conversion is not possible.

ExampleMetadata: infused

Examples
Bucket bucket;
// Provide a Lambda function that will transform records before delivery, with custom
// buffering and retry configuration
Function lambdaFunction = new Function(this, "Processor", new FunctionProps {
    Runtime = Runtime.NODEJS_12_X,
    Handler = "index.handler",
    Code = Code.FromAsset(Join(__dirname, "process-records"))
});
LambdaFunctionProcessor lambdaProcessor = new LambdaFunctionProcessor(lambdaFunction, new DataProcessorProps {
    BufferInterval = Duration.Minutes(5),
    BufferSize = Size.Mebibytes(5),
    Retries = 5
});
S3Bucket s3Destination = new S3Bucket(bucket, new S3BucketProps {
    Processor = lambdaProcessor
});
new DeliveryStream(this, "Delivery Stream", new DeliveryStreamProps {
    Destinations = new [] { s3Destination }
});

Synopsis

Constructors

Size(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Size(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Methods

Gibibytes(Double)

Create a Storage representing an amount gibibytes.

IsUnresolved()

Checks if size is a token or a resolvable object.

Kibibytes(Double)

Create a Storage representing an amount kibibytes.

Mebibytes(Double)

Create a Storage representing an amount mebibytes.

Pebibyte(Double)

(deprecated) Create a Storage representing an amount pebibytes.

Pebibytes(Double)

Create a Storage representing an amount pebibytes.

Tebibytes(Double)

Create a Storage representing an amount tebibytes.

ToGibibytes(ISizeConversionOptions)

Return this storage as a total number of gibibytes.

ToKibibytes(ISizeConversionOptions)

Return this storage as a total number of kibibytes.

ToMebibytes(ISizeConversionOptions)

Return this storage as a total number of mebibytes.

ToPebibytes(ISizeConversionOptions)

Return this storage as a total number of pebibytes.

ToTebibytes(ISizeConversionOptions)

Return this storage as a total number of tebibytes.

Constructors

Size(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Size(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Size(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Size(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Methods

Gibibytes(Double)

Create a Storage representing an amount gibibytes.

public static Size Gibibytes(double amount)
Parameters
amount System.Double

the amount of gibibytes to be represented.

Returns

Size

a new Size instance

Remarks

1 GiB = 1024 MiB

IsUnresolved()

Checks if size is a token or a resolvable object.

public virtual bool IsUnresolved()
Returns

System.Boolean

Kibibytes(Double)

Create a Storage representing an amount kibibytes.

public static Size Kibibytes(double amount)
Parameters
amount System.Double

the amount of kibibytes to be represented.

Returns

Size

a new Size instance

Remarks

1 KiB = 1024 bytes

Mebibytes(Double)

Create a Storage representing an amount mebibytes.

public static Size Mebibytes(double amount)
Parameters
amount System.Double

the amount of mebibytes to be represented.

Returns

Size

a new Size instance

Remarks

1 MiB = 1024 KiB

Pebibyte(Double)

(deprecated) Create a Storage representing an amount pebibytes.

public static Size Pebibyte(double amount)
Parameters
amount System.Double
Returns

Size

Remarks

1 PiB = 1024 TiB

Stability: Deprecated

Pebibytes(Double)

Create a Storage representing an amount pebibytes.

public static Size Pebibytes(double amount)
Parameters
amount System.Double

the amount of pebibytes to be represented.

Returns

Size

a new Size instance

Remarks

1 PiB = 1024 TiB

Tebibytes(Double)

Create a Storage representing an amount tebibytes.

public static Size Tebibytes(double amount)
Parameters
amount System.Double

the amount of tebibytes to be represented.

Returns

Size

a new Size instance

Remarks

1 TiB = 1024 GiB

ToGibibytes(ISizeConversionOptions)

Return this storage as a total number of gibibytes.

public virtual double ToGibibytes(ISizeConversionOptions opts = null)
Parameters
opts ISizeConversionOptions

the conversion options.

Returns

System.Double

the quantity of bytes expressed in gibibytes

ToKibibytes(ISizeConversionOptions)

Return this storage as a total number of kibibytes.

public virtual double ToKibibytes(ISizeConversionOptions opts = null)
Parameters
opts ISizeConversionOptions

the conversion options.

Returns

System.Double

the quantity of bytes expressed in kibibytes

ToMebibytes(ISizeConversionOptions)

Return this storage as a total number of mebibytes.

public virtual double ToMebibytes(ISizeConversionOptions opts = null)
Parameters
opts ISizeConversionOptions

the conversion options.

Returns

System.Double

the quantity of bytes expressed in mebibytes

ToPebibytes(ISizeConversionOptions)

Return this storage as a total number of pebibytes.

public virtual double ToPebibytes(ISizeConversionOptions opts = null)
Parameters
opts ISizeConversionOptions

the conversion options.

Returns

System.Double

the quantity of bytes expressed in pebibytes

ToTebibytes(ISizeConversionOptions)

Return this storage as a total number of tebibytes.

public virtual double ToTebibytes(ISizeConversionOptions opts = null)
Parameters
opts ISizeConversionOptions

the conversion options.

Returns

System.Double

the quantity of bytes expressed in tebibytes

Back to top Generated by DocFX