Table of Contents

Class DeleteItemRequest

Namespace
DynaSharp.Requests
Assembly
DynaSharp.dll

Deletes a single item by its full primary key (DynamoDB DeleteItem).

public sealed record DeleteItemRequest : IEquatable<DeleteItemRequest>
Inheritance
DeleteItemRequest
Implements
Inherited Members

Remarks

Deleting an item that does not exist is not an error: the call succeeds and changes nothing, unless a ConditionExpression requires the item to exist.

Constructors

DeleteItemRequest()

public DeleteItemRequest()

Properties

ConditionExpression

Gets a condition on the existing item that must hold for the delete to happen, for example "attribute_exists(pk) AND version = :expected". When it does not hold, the call throws ConditionalCheckFailedException and the item stays. At most 4 KB. Attribute names that are DynamoDB reserved words, such as name, status, size, order or total, must be aliased with a #placeholder defined in ExpressionAttributeNames; written directly, DynamoDB rejects the request with a ValidationException. See the list of reserved words.

public string? ConditionExpression { get; init; }

Property Value

string

ExpressionAttributeNames

Gets the substitutions for #name placeholders in ConditionExpression. A placeholder that the expression does not use makes DynamoDB reject the request. Use it to alias attribute names that are DynamoDB reserved words, such as name, status, size, order or total, which DynamoDB rejects with a ValidationException when an expression uses them directly (the check is case-insensitive), and names with a dot or other special characters. See the list of reserved words.

public IReadOnlyDictionary<string, string>? ExpressionAttributeNames { get; init; }

Property Value

IReadOnlyDictionary<string, string>

ExpressionAttributeValues

Gets the substitutions for :value placeholders in ConditionExpression. A placeholder that the expression does not use, or that no value defines, makes DynamoDB reject the request.

public IReadOnlyDictionary<string, AttributeValue>? ExpressionAttributeValues { get; init; }

Property Value

IReadOnlyDictionary<string, AttributeValue>

Key

Gets the full primary key of the item: the partition key and, if the table has one, the sort key.

public required IReadOnlyDictionary<string, AttributeValue> Key { get; init; }

Property Value

IReadOnlyDictionary<string, AttributeValue>

ReturnConsumedCapacity

Gets whether to report consumed capacity in ConsumedCapacity.

public ReturnConsumedCapacity ReturnConsumedCapacity { get; init; }

Property Value

ReturnConsumedCapacity

ReturnItemCollectionMetrics

Gets whether to report the size of the item collection in ItemCollectionMetrics. Only tables with a local secondary index have item collections.

public ReturnItemCollectionMetrics ReturnItemCollectionMetrics { get; init; }

Property Value

ReturnItemCollectionMetrics

ReturnValues

Gets what to return in Attributes: None or AllOld. DynamoDB rejects the other values.

public ReturnValue ReturnValues { get; init; }

Property Value

ReturnValue

ReturnValuesOnConditionCheckFailure

Gets whether a failed condition returns the existing item in Item.

public ReturnValuesOnConditionCheckFailure ReturnValuesOnConditionCheckFailure { get; init; }

Property Value

ReturnValuesOnConditionCheckFailure

TableName

Gets the table name (or table ARN).

public required string TableName { get; init; }

Property Value

string

Methods

Equals(DeleteItemRequest?)

public bool Equals(DeleteItemRequest? other)

Parameters

other DeleteItemRequest

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(DeleteItemRequest?, DeleteItemRequest?)

public static bool operator ==(DeleteItemRequest? left, DeleteItemRequest? right)

Parameters

left DeleteItemRequest
right DeleteItemRequest

Returns

bool

operator !=(DeleteItemRequest?, DeleteItemRequest?)

public static bool operator !=(DeleteItemRequest? left, DeleteItemRequest? right)

Parameters

left DeleteItemRequest
right DeleteItemRequest

Returns

bool